public class KMLUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
KML_FRACTION |
static String |
KML_INSET_PIXELS |
static String |
KML_PIXELS |
Constructor and Description |
---|
KMLUtil() |
Modifier and Type | Method and Description |
---|---|
static ShapeAttributes |
assembleInteriorAttributes(ShapeAttributes attrs,
KMLPolyStyle style) |
static ShapeAttributes |
assembleLineAttributes(ShapeAttributes attrs,
KMLLineStyle style) |
static List<Position> |
computeAltitude(Globe globe,
List<? extends Position> positions,
String altitudeMode)
Compute the altitude of each position in a list, based on altitude mode.
|
static Position |
computeAltitude(Globe globe,
Position position,
String altitudeMode)
Create a
Position , taking into account an altitude mode. |
static int |
convertAltitudeMode(String altMode,
int defaultAltMode) |
static Sector |
createSectorFromLatLonBox(KMLAbstractLatLonBoxType box)
Creates a
Sector from a KMLAbstractLatLonBoxType's north ,
south , east , and west coordinates. |
static void |
getPositions(Globe globe,
KMLAbstractGeometry geometry,
List<Position> positions)
Get all of the positions that make up a
KMLAbstractGeometry . |
static boolean |
isHighlightStyleState(KMLAbstractSubStyle subStyle)
Indicate whether a specified sub-style has the "highlight" style-state field.
|
static String |
kmlUnitsToWWUnits(String units)
Translate a KML units string ("pixels", "insetPixels", or "fraction") into the corresponding WW unit constant
(
AVKey.PIXELS , AVKey.INSET_PIXELS , or AVKey.FRACTION . |
static List<LatLon> |
rotateSector(Globe globe,
Sector sector,
Angle rotation)
Rotate the corners of a sector around a normal vector through the sector centroid.
|
static String |
wwUnitsToKMLUnits(String units)
Translate a WorldWind units constant (
AVKey.PIXELS , AVKey.INSET_PIXELS , or AVKey.FRACTION
to the corresponding KML unit string ("pixels", "insetPixels", or "fraction"). |
public static final String KML_FRACTION
public static final String KML_INSET_PIXELS
public static final String KML_PIXELS
public static ShapeAttributes assembleInteriorAttributes(ShapeAttributes attrs, KMLPolyStyle style)
public static ShapeAttributes assembleLineAttributes(ShapeAttributes attrs, KMLLineStyle style)
public static List<Position> computeAltitude(Globe globe, List<? extends Position> positions, String altitudeMode)
globe
- Globe to use to determine altitude above terrain.positions
- Positions to compute altitude for.altitudeMode
- A KML altitude mode string.altitudeMode
.public static Position computeAltitude(Globe globe, Position position, String altitudeMode)
Position
, taking into account an altitude mode.globe
- Globe to use to determine altitude above terrain.position
- Position to evaluate.altitudeMode
- A KML altitude mode string.public static int convertAltitudeMode(String altMode, int defaultAltMode)
public static Sector createSectorFromLatLonBox(KMLAbstractLatLonBoxType box)
Sector
from a KMLAbstractLatLonBoxType's
north
,
south
, east
, and west
coordinates. This returns null
if any
of these coordinates are unspecified.box
- a box who's coordinates define a Sector
.Sector
that bounds the specified box's
coordinates.IllegalArgumentException
- if the box
is null
.public static void getPositions(Globe globe, KMLAbstractGeometry geometry, List<Position> positions)
KMLAbstractGeometry
. If the geometry contains other geometries,
this method collects all the points from all of the geometries.globe
- Globe to use to determine altitude above terrain.geometry
- Geometry to collect positions from.positions
- Placemark positions will be added to this list.public static boolean isHighlightStyleState(KMLAbstractSubStyle subStyle)
subStyle
- the sub-style to test. May be null, in which case this method returns false.public static String kmlUnitsToWWUnits(String units)
AVKey.PIXELS
, AVKey.INSET_PIXELS
, or AVKey.FRACTION
.units
- KML units to translate.public static List<LatLon> rotateSector(Globe globe, Sector sector, Angle rotation)
globe
- Globe to use to compute rotated positions.sector
- Sector to rotate.rotation
- Rotation angle. Positive angles produce counterclockwise rotation.public static String wwUnitsToKMLUnits(String units)
AVKey.PIXELS
, AVKey.INSET_PIXELS
, or AVKey.FRACTION
to the corresponding KML unit string ("pixels", "insetPixels", or "fraction").units
- World Wind units to translate.