public class KMLUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
KML_FRACTION |
static java.lang.String |
KML_INSET_PIXELS |
static java.lang.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 java.util.List<Position> |
computeAltitude(Globe globe,
java.util.List<? extends Position> positions,
java.lang.String altitudeMode)
Compute the altitude of each position in a list, based on altitude mode.
|
static Position |
computeAltitude(Globe globe,
Position position,
java.lang.String altitudeMode)
Create a
Position , taking into account an altitude mode. |
static int |
convertAltitudeMode(java.lang.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,
java.util.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 java.lang.String |
kmlUnitsToWWUnits(java.lang.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 java.util.List<LatLon> |
rotateSector(Globe globe,
Sector sector,
Angle rotation)
Rotate the corners of a sector around a normal vector through the sector centroid.
|
static java.lang.String |
wwUnitsToKMLUnits(java.lang.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 java.lang.String KML_FRACTION
public static final java.lang.String KML_INSET_PIXELS
public static final java.lang.String KML_PIXELS
public static ShapeAttributes assembleInteriorAttributes(ShapeAttributes attrs, KMLPolyStyle style)
public static ShapeAttributes assembleLineAttributes(ShapeAttributes attrs, KMLLineStyle style)
public static java.util.List<Position> computeAltitude(Globe globe, java.util.List<? extends Position> positions, java.lang.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, java.lang.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(java.lang.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.java.lang.IllegalArgumentException
- if the box
is null
.public static void getPositions(Globe globe, KMLAbstractGeometry geometry, java.util.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 java.lang.String kmlUnitsToWWUnits(java.lang.String units)
AVKey.PIXELS
, AVKey.INSET_PIXELS
, or AVKey.FRACTION
.units
- KML units to translate.public static java.util.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 java.lang.String wwUnitsToKMLUnits(java.lang.String units)
AVKey.PIXELS
, AVKey.INSET_PIXELS
, or AVKey.FRACTION
to the corresponding KML unit string ("pixels", "insetPixels", or "fraction").units
- WorldWind units to translate.