public interface Globe extends WWObject, Extent
ElevationModel
that provides
elevations for geographic positions on the surface of the globe. Globe provides methods for converting geographic
positions (latitude, longitude, and elevation) to cartesian coordinates, and for converting cartesian to geographic.
The origin and orientation of the cartesian coordinate system are determined by implementations of this interface.
Globe provides methods for performing computations in the coordinate system represented by a globe's surface in
cartesian coordinates. These methods perform work with respect to the globe's actual shape in 3D cartesian
coordinates. For an ellipsoidal globe, these methods are equivalent to the ellipsoidal coordinate computations below.
For an instance of Globe2D
, these methods work in the cartesian coordinates specified by the globe's 2D
projection.
computePointFromPosition(gov.nasa.worldwind.geom.Angle, gov.nasa.worldwind.geom.Angle, double)
computePositionFromPoint(gov.nasa.worldwind.geom.Vec4)
computeSurfaceNormalAtLocation(gov.nasa.worldwind.geom.Angle, gov.nasa.worldwind.geom.Angle)
computeSurfaceOrientationAtPosition(gov.nasa.worldwind.geom.Angle, gov.nasa.worldwind.geom.Angle, double)
Globe provides methods for performing computation on the ellipsoid represented by a globe's equatorial radius and its polar radius. These methods perform work with respect to the ellipsoid in 3D cartesian coordinates. Calling any of these methods on an instance of Globe2D will return the same result as a 3D globe with equivalent radii.
computeEllipsoidalPointFromPosition(gov.nasa.worldwind.geom.Angle, gov.nasa.worldwind.geom.Angle,
double)
computePositionFromEllipsoidalPoint(gov.nasa.worldwind.geom.Vec4)
computeEllipsoidalNormalAtLocation(gov.nasa.worldwind.geom.Angle, gov.nasa.worldwind.geom.Angle)
computeEllipsoidalOrientationAtPosition(gov.nasa.worldwind.geom.Angle, gov.nasa.worldwind.geom.Angle, double)
Modifier and Type | Method and Description |
---|---|
Vec4 |
computeEllipsoidalNormalAtLocation(Angle latitude,
Angle longitude)
Computes a vector perpendicular to the surface of the ellipsoid specified by this globe, in cartesian
coordinates.
|
Matrix |
computeEllipsoidalOrientationAtPosition(Angle latitude,
Angle longitude,
double metersElevation)
Returns the cartesian transform matrix that maps local model coordinates to an ellipsoidal coordinate system at
(latitude, longitude, metersElevation).
|
Vec4 |
computeEllipsoidalPointFromLocation(LatLon location)
Computes a ellipsoidal point from a latitude and longitude.
|
Vec4 |
computeEllipsoidalPointFromPosition(Angle latitude,
Angle longitude,
double metersElevation)
Computes a ellipsoidal point from a latitude, longitude, and elevation.
|
Vec4 |
computeEllipsoidalPointFromPosition(Position position)
Computes a ellipsoidal point from a latitude, longitude, and elevation.
|
Matrix |
computeModelCoordinateOriginTransform(Angle latitude,
Angle longitude,
double metersElevation) |
Matrix |
computeModelCoordinateOriginTransform(Position position) |
Vec4 |
computeNorthPointingTangentAtLocation(Angle latitude,
Angle longitude)
Computes a vector tangent to this globe and pointing toward the north pole.
|
Vec4 |
computePointFromLocation(LatLon location)
Computes a cartesian point from a geographic location on the surface of this globe.
|
Vec4 |
computePointFromPosition(Angle latitude,
Angle longitude,
double metersElevation)
Computes a cartesian point from a latitude, longitude, and elevation.
|
Vec4 |
computePointFromPosition(LatLon latLon,
double metersElevation)
Computes a cartesian point from a geographic location and elevation.
|
Vec4 |
computePointFromPosition(Position position)
Computes a cartesian point from a geographic position.
|
void |
computePointsFromPositions(Sector sector,
int numLat,
int numLon,
double[] metersElevation,
Vec4[] out)
Computes a grid of cartesian points corresponding to a grid of geographic positions.
|
Position |
computePositionFromEllipsoidalPoint(Vec4 ellipsoidalPoint)
Computes the geographic position of a point in ellipsoidal coordinates.
|
Position |
computePositionFromPoint(Vec4 point)
Computes the geographic position of a point in cartesian coordinates.
|
Vec4 |
computeSurfaceNormalAtLocation(Angle latitude,
Angle longitude)
Computes a vector perpendicular to the surface of this globe in cartesian coordinates.
|
Vec4 |
computeSurfaceNormalAtPoint(Vec4 point)
Computes a vector perpendicular to the surface of this globe, at a cartesian point.
|
Matrix |
computeSurfaceOrientationAtPosition(Angle latitude,
Angle longitude,
double metersElevation)
Returns the cartesian transform matrix that maps model coordinates to a local coordinate system at (latitude,
longitude, metersElevation).
|
Matrix |
computeSurfaceOrientationAtPosition(Position position)
Returns the cartesian transform matrix that maps model coordinates to a local coordinate system at (latitude,
longitude, metersElevation).
|
double |
getEccentricitySquared()
Indicates the square of this globe's eccentricity.
|
double |
getElevation(Angle latitude,
Angle longitude)
Indicates the elevation at a specified location.
|
ElevationModel |
getElevationModel()
Indicates this globe's elevation model.
|
double[] |
getElevations(Sector sector,
java.util.List<? extends LatLon> latlons,
double[] targetResolution,
double[] elevations)
Indicates the elevations of a collection of locations.
|
double |
getElevations(Sector sector,
java.util.List<? extends LatLon> latlons,
double targetResolution,
double[] elevations)
Indicates the elevations of a collection of locations.
|
double |
getEquatorialRadius()
Indicates the radius of the globe at the equator, in meters.
|
Extent |
getExtent()
Indicates the spatial volume contained by this globe.
|
GlobeStateKey |
getGlobeStateKey()
Returns a typed state key identifying this globe's current configuration.
|
GlobeStateKey |
getGlobeStateKey(DrawContext dc)
Returns a typed state key identifying this globe's current configuration.
|
Position |
getIntersectionPosition(Line line)
Computes the intersections of this globe and a line.
|
double |
getMaxElevation()
Indicates the maximum elevation on this globe, in meters.
|
double |
getMaximumRadius()
Indicates the maximum radius on the globe.
|
double[] |
getMinAndMaxElevations(Angle latitude,
Angle longitude)
Returns the minimum and maximum elevations at a specified location on this Globe.
|
double[] |
getMinAndMaxElevations(Sector sector)
Returns the minimum and maximum elevations within a specified sector on this Globe.
|
double |
getMinElevation()
Indicates the minimum elevation on this globe, in meters.
|
double |
getPolarRadius()
Indicates the radius of the globe at the poles, in meters.
|
double |
getRadiusAt(Angle latitude,
Angle longitude)
Indicates the radius in meters of the globe's ellipsoid at a location.
|
double |
getRadiusAt(LatLon location)
Indicates the radius in meters of the globe's ellipsoid at a location.
|
java.lang.Object |
getStateKey(DrawContext dc)
Returns a state key identifying this globe's current configuration.
|
Tessellator |
getTessellator()
Returns this globe's current tessellator.
|
Intersection[] |
intersect(Line line,
double altitude)
Intersects a specified line with this globe.
|
Intersection[] |
intersect(Triangle triangle,
double altitude)
Intersects a specified triangle with the globe.
|
boolean |
isPointAboveElevation(Vec4 point,
double elevation)
Determines whether a point is above a given elevation.
|
void |
setElevationModel(ElevationModel elevationModel)
Specifies this globe's elevation model.
|
void |
setTessellator(Tessellator tessellator)
Specifies this globe's tessellator.
|
SectorGeometryList |
tessellate(DrawContext dc)
Tessellate this globe for the currently visible region.
|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
onMessage
getCenter, getDiameter, getEffectiveRadius, getProjectedArea, getRadius, intersect, intersects, intersects, intersects
Vec4 computeEllipsoidalNormalAtLocation(Angle latitude, Angle longitude)
The returned vector is a function of this globe's equatorial radius and its polar radius, and always represents a vector normal to the corresponding ellipsoid in 3D cartesian coordinates. Calling this method on an instance of Globe2D will return a vector normal to the ellipsoid defined by the 2D globe's radii.
latitude
- Latitude of the location at which to compute the normal vector.longitude
- Longitude of the location at which to compute the normal vector.java.lang.IllegalArgumentException
- if either angle is null.Matrix computeEllipsoidalOrientationAtPosition(Angle latitude, Angle longitude, double metersElevation)
The returned matrix is a function of this globe's equatorial radius and its polar radius, and always represents a transform matrix appropriate for the corresponding ellipsoid in 3D cartesian coordinates. Calling this method on an instance of Globe2D will return a transform matrix for the ellipsoid defined by the 2D globe's radii.
latitude
- the latitude of the position.longitude
- the longitude of the position.metersElevation
- the number of meters above or below mean sea level.Vec4 computeEllipsoidalPointFromLocation(LatLon location)
The returned point is a function of this globe's equatorial radius and its polar radius, and always represents a point on the ellipsoid in 3D cartesian coordinates that corresponds to the specified location. Calling this method on an instance of Globe2D will return a point on the ellipsoid defined by the 2D globe's radii.
location
- the location to convert.java.lang.IllegalArgumentException
- if the specified location is null.Vec4 computeEllipsoidalPointFromPosition(Angle latitude, Angle longitude, double metersElevation)
The returned point is a function of this globe's equatorial radius and its polar radius, and always represents a point on the ellipsoid in 3D cartesian coordinates that corresponds to the specified position. Calling this method on an instance of Globe2D will return a point on the ellipsoid defined by the 2D globe's radii.
latitude
- Latitude of the location to convert.longitude
- Longitude of the location to convert.metersElevation
- Elevation, in meters, of the geographic position to convert.java.lang.IllegalArgumentException
- if the specified latitude or longitude is null.Vec4 computeEllipsoidalPointFromPosition(Position position)
The returned point is a function of this globe's equatorial radius and its polar radius, and always represents a point on the ellipsoid in 3D cartesian coordinates that corresponds to the specified position. Calling this method on an instance of Globe2D will return a point on the ellipsoid defined by the 2D globe's radii.
position
- Position of the location to convert.java.lang.IllegalArgumentException
- if the specified position is null.Matrix computeModelCoordinateOriginTransform(Angle latitude, Angle longitude, double metersElevation)
latitude
- Latitude of the location.longitude
- Longitude of the location.metersElevation
- Elevation of the locationcomputeSurfaceOrientationAtPosition(gov.nasa.worldwind.geom.Angle, gov.nasa.worldwind.geom.Angle, double)
Matrix computeModelCoordinateOriginTransform(Position position)
position
- PositioncomputeSurfaceOrientationAtPosition(gov.nasa.worldwind.geom.Position)
Vec4 computeNorthPointingTangentAtLocation(Angle latitude, Angle longitude)
latitude
- Latitude of the location at which to compute the tangent vector.longitude
- Longitude of the location at which to compute the tangent vector.Vec4 computePointFromLocation(LatLon location)
location
- Geographic location on the surface of the globe to convert to cartesian.Vec4 computePointFromPosition(Angle latitude, Angle longitude, double metersElevation)
latitude
- Latitude of the location to convert to cartesian.longitude
- Longitude of the location to convert to cartesian.metersElevation
- Elevation, in meters, of the geographic position to convert to cartesian.Vec4 computePointFromPosition(LatLon latLon, double metersElevation)
latLon
- Geographic location to convert to cartesian.metersElevation
- Elevation, in meters, of the geographic position to convert to cartesian.Vec4 computePointFromPosition(Position position)
position
- Geographic position to convert to cartesian. The position may include elevation above or below
the globe's surface.void computePointsFromPositions(Sector sector, int numLat, int numLon, double[] metersElevation, Vec4[] out)
This method provides an interface for efficient generation of a grid of cartesian points within a sector. The
grid is constructed by dividing the sector into numLon x numLat
evenly separated points in
geographic coordinates. The first and last points in latitude and longitude are placed at the sector's minimum
and maximum boundary, and the remaining points are spaced evenly between those boundary points.
For each grid point within the sector, an elevation value is specified via an array of elevations. The calculation at each position incorporates the associated elevation.
sector
- The sector over which to generate the points.numLat
- The number of points to generate latitudinally.numLon
- The number of points to generate longitudinally.metersElevation
- An array of elevations to incorporate in the point calculations. There must be one
elevation value in the array for each generated point, so the array must have a length of
at least numLon x numLat
. Elevations are read from this array in row major
order, beginning with the row of minimum latitude.out
- An array to hold the computed cartesian points. It must have a length of at least
numLon x numLat
. Points are written to this array in row major order,
beginning with the row of minimum latitude.java.lang.IllegalArgumentException
- If any argument is null, or if numLat or numLon are less than or equal to zero.Position computePositionFromEllipsoidalPoint(Vec4 ellipsoidalPoint)
The returned position is a function of this globe's equatorial radius and its polar radius, and always represents a position corresponding to the point on the ellipsoid in 3D cartesian coordinates. Calling this method on an instance of Globe2D will return a position corresponding to the ellipsoid defined by the 2D globe's radii.
ellipsoidalPoint
- Point of which to find the geographic position, relative to the ellipsoid defined by the
globe's radii.Position computePositionFromPoint(Vec4 point)
point
- Point of which to find the geographic position.Vec4 computeSurfaceNormalAtLocation(Angle latitude, Angle longitude)
latitude
- Latitude of the location at which to compute the normal vector.longitude
- Longitude of the location at which to compute the normal vector.Vec4 computeSurfaceNormalAtPoint(Vec4 point)
point
- Point in cartesian coordinates at which to compute the normal vector.Matrix computeSurfaceOrientationAtPosition(Angle latitude, Angle longitude, double metersElevation)
latitude
- the latitude of the position.longitude
- the longitude of the position.metersElevation
- the number of meters above or below mean sea level.Matrix computeSurfaceOrientationAtPosition(Position position)
position
- the latitude, longitude, and number of meters above or below mean sea level.double getEccentricitySquared()
double getElevation(Angle latitude, Angle longitude)
The elevation returned from this method is the best available in memory. If no elevation is in memory, the elevation model's minimum extreme elevation at the location is returned. Local disk caches are not consulted.
latitude
- the latitude of the location at which to determine elevation.longitude
- the longitude of the location at which to determine elevation.getElevationModel()
ElevationModel getElevationModel()
double[] getElevations(Sector sector, java.util.List<? extends LatLon> latlons, double[] targetResolution, double[] elevations)
sector
- the sector in question.latlons
- the locations to return elevations for. If a location is null, the output buffer for that
location is not modified.targetResolution
- the desired horizontal resolution, in radians, of the raster or other elevation sample
from which elevations are drawn. (To compute radians from a distance, divide the distance
by the radius of the globe, ensuring that both the distance and the radius are in the
same units.) This parameter is an array to allow varying resolutions to be specified for
CompoundElevationModel
.elevations
- an array in which to place the returned elevations. The array must be pre-allocated and
contain at least as many elements as the list of locations.Double.MAX_VALUE
if individual elevations cannot be
determined for all of the locations. Returns zero if an elevation model is not available.java.lang.IllegalArgumentException
- if either the sector, latlons list, target resolutions array or elevations array
is null.getElevationModel()
double getElevations(Sector sector, java.util.List<? extends LatLon> latlons, double targetResolution, double[] elevations)
sector
- the sector in question.latlons
- the locations to return elevations for. If a location is null, the output buffer for that
location is not modified.targetResolution
- the desired horizontal resolution, in radians, of the raster or other elevation sample
from which elevations are drawn. (To compute radians from a distance, divide the distance
by the radius of the globe, ensuring that both the distance and the radius are in the
same units.)elevations
- an array in which to place the returned elevations. The array must be pre-allocated and
contain at least as many elements as the list of locations.Double.MAX_VALUE
if individual elevations cannot be
determined for all of the locations. Returns zero if an elevation model is not available.java.lang.IllegalArgumentException
- if either the sector, latlons list or elevations array is null.getElevationModel()
double getEquatorialRadius()
Extent getExtent()
GlobeStateKey getGlobeStateKey()
java.lang.IllegalArgumentException
- if the draw context is null.GlobeStateKey getGlobeStateKey(DrawContext dc)
dc
- the current draw context.java.lang.IllegalArgumentException
- if the draw context is null.Position getIntersectionPosition(Line line)
line
- the line with which to intersect this globe.double getMaxElevation()
double getMaximumRadius()
double[] getMinAndMaxElevations(Angle latitude, Angle longitude)
latitude
- the latitude of the location in question.longitude
- the longitude of the location in question.double
array indicating the minimum and maximum elevations at the specified
location, respectively. These values are the global minimum and maximum if the local minimum and maximum
values are currently unknown, or zero if this Globe has no elevation model.double[] getMinAndMaxElevations(Sector sector)
sector
- the sector in question.double
array indicating the sector's minimum and maximum elevations,
respectively. These elements are the global minimum and maximum if the local minimum and maximum values
are currently unknown, or zero if this Globe has no elevation model.double getMinElevation()
double getPolarRadius()
double getRadiusAt(Angle latitude, Angle longitude)
latitude
- Latitude of the location at which to determine radius.longitude
- Longitude of the location at which to determine radius.double getRadiusAt(LatLon location)
location
- the location at which to determine radius.java.lang.Object getStateKey(DrawContext dc)
dc
- the current draw context.java.lang.IllegalArgumentException
- if the draw context is null.Tessellator getTessellator()
Intersection[] intersect(Line line, double altitude)
line
- the line to intersect.altitude
- a distance in meters to expand the globe's equatorial and polar radii prior to performing the
intersection.line
is null.Intersection[] intersect(Triangle triangle, double altitude)
triangle
- the triangle to intersect.altitude
- a distance in meters to expand the globe's equatorial and polar radii prior to performing the
intersection.triangle
is null.boolean isPointAboveElevation(Vec4 point, double elevation)
point
- the Vec4
point to test. If null, this method returns false.elevation
- the elevation to test for.void setElevationModel(ElevationModel elevationModel)
elevationModel
- this globe's elevation model. May be null to indicate no elevation model.void setTessellator(Tessellator tessellator)
tessellator
- the new tessellator. Specify null to use the default tessellator.SectorGeometryList tessellate(DrawContext dc)
dc
- the current draw context.java.lang.IllegalStateException
- if the globe has no tessellator and a default tessellator cannot be created.