public class EarthGravityModel96MeanSeaLevel extends RasterTerrainProvider
The following example shows how to create an instance of this class from the embedded data and configure it for use as the official mean sea level surface by the rest of the library:
EarthCentralBody earth = CentralBodiesFacet.getFromContext().getEarth();
EarthGravityModel96MeanSeaLevel msl = new EarthGravityModel96MeanSeaLevel();
earth.setMeanSeaLevel(msl);
The embedded binary geoid height data file WW15MGH.DAC was obtained from NGA.
Constructor and Description |
---|
EarthGravityModel96MeanSeaLevel()
Initializes a new instance.
|
EarthGravityModel96MeanSeaLevel(InputStream stream)
Initializes a new instance.
|
EarthGravityModel96MeanSeaLevel(String fileName)
Initializes a new instance.
|
Modifier and Type | Method and Description |
---|---|
double |
getHeight(double longitude,
double latitude)
Gets the interpolated height of the terrain at the specified longitude and latitude using the
default interpolator for this terrain provider.
|
double |
getHeightNativeUnits(double longitude,
double latitude)
Gets the interpolated height of the terrain at the specified longitude and latitude.
|
TerrainPosts |
getPosts(RasterTerrainIndexExtent extent)
Gets the posts over a specified area by reading them from the terrain data source.
|
cartographicExtentToIndexExtent, getCache, getDefaultInterpolator, getDeltaLatitude, getDeltaLatitudeNativeUnits, getDeltaLongitude, getDeltaLongitudeNativeUnits, getEasternPostOffsetNativeUnits, getFirstPartials, getFirstPartials, getHeight, getHeightNativeUnits, getHeightRelativeToShape, getLatitudePosts, getLongitudePosts, getMinimumSampleSpacing, getNeedsSpecialCoordinateProcessing, getNorthernPostOffsetNativeUnits, getSecondPartials, getSecondPartials, getSouthernPostOffsetNativeUnits, getWesternPostOffsetNativeUnits, indexToLatitude, indexToLongitude, latitudeToIndex, longitudeToIndex, preloadExtent, processCoordinates, setDefaultInterpolator, setDeltaLatitude, setDeltaLatitudeNativeUnits, setDeltaLongitude, setDeltaLongitudeNativeUnits, setEasternPostOffsetNativeUnits, setLatitudePosts, setLongitudePosts, setNeedsSpecialCoordinateProcessing, setNorthernPostOffsetNativeUnits, setSouthernPostOffsetNativeUnits, setWesternPostOffsetNativeUnits, unloadExtent
getBoundingExtent, getBoundingExtentNativeUnits, getGradient, getHeightReference, getHeightRelativeToShape, getHessian, getLocalMinimumSampleSpacing, getNativeToMeters, getNormal, getRadiansToNative, getReferenceSurface, getShape, getShapeFixedFrame, inGlobalBounds, setBoundingExtent, setBoundingExtentNativeUnits, setHeightReference, setNativeToMeters, setRadiansToNative, setReferenceSurface, setShape, setShapeFixedFrame
public EarthGravityModel96MeanSeaLevel()
public EarthGravityModel96MeanSeaLevel(@Nonnull String fileName)
fileName
- The file name of the binary geoid height data file defined by NGA.ArgumentNullException
- Thrown when fileName
is null
.InvalidDataException
- Thrown when the FileStream
created from the fileName
terminates
unexpectedly before the required terrain data could be read.public EarthGravityModel96MeanSeaLevel(@Nonnull InputStream stream)
stream
- A stream containing the binary geoid height data file defined by NGA.ArgumentNullException
- Thrown when stream
is null
.InvalidDataException
- Thrown when stream
terminates
unexpectedly before the required terrain data could be read.public double getHeight(double longitude, double latitude)
If HeightReference
(get
/ set
) is HeightReference.REFERENCE_SURFACE
,
the returned height is relative to the surface specified by the ReferenceSurface
(get
/ set
) property.
If HeightReference
(get
/ set
) is HeightReference.SHAPE
,
the returned height is relative to the ellipsoid specified by the Shape
(get
/ set
) property.
This method may return Double.NaN
if the requested longitude and latitude are outside
the terrain region or if the terrain data indicates that the height is unknown.
It is safe to call this method from multiple threads simultaneously.
getHeight
in class RasterTerrainProvider
longitude
- The longitude, in radians.
Requesting a height for a longitude less than -π or greater than π will always return Double.NaN
.latitude
- The latitude, in radians.
Requesting a height for a latitude less than -π/2 or greater than π/2 will always return Double.NaN
.Double.NaN
if the height is not available at the requested longitude and latitude.public double getHeightNativeUnits(double longitude, double latitude)
If HeightReference
(get
/ set
) is HeightReference.REFERENCE_SURFACE
,
the returned height is relative to the surface specified by the ReferenceSurface
(get
/ set
) property.
If HeightReference
(get
/ set
) is HeightReference.SHAPE
,
the returned height is relative to the ellipsoid specified by the Shape
(get
/ set
) property.
This method may return Double.NaN
if the requested longitude and latitude are outside
the terrain region or if the terrain data indicates that the height is unknown.
It is safe to call this method from multiple threads simultaneously.
getHeightNativeUnits
in class RasterTerrainProvider
longitude
- The longitude, in the native units of the terrain provider.latitude
- The latitude, in the native units of the terrain provider.Double.NaN
if the height is not available at the requested longitude and latitude.public TerrainPosts getPosts(@Nonnull RasterTerrainIndexExtent extent)
getPosts
in class RasterTerrainProvider
extent
- The extent of the posts to read.