public class NgaDigitalTerrainElevationData extends TerrainProvider
Constructor and Description |
---|
NgaDigitalTerrainElevationData(FileStreamFactory dmedFileStreamFactory)
Initializes a new instance with the specified file stream factory for a DMED file.
|
NgaDigitalTerrainElevationData(FileStreamFactory dmedFileStreamFactory,
TerrainCacheGroup cacheGroup)
Initializes a new instance with the specified file stream factory for a DMED file.
|
NgaDigitalTerrainElevationData(String dmedFileName)
Initializes a new instance using the specified DMED filename.
|
NgaDigitalTerrainElevationData(String dtedDirectory,
int southLatitudeDegrees,
int northLatitudeDegrees,
int westLongitudeDegrees,
int eastLongitudeDegrees)
Initializes a new instance with the specified information.
|
NgaDigitalTerrainElevationData(String dtedDirectory,
int southLatitudeDegrees,
int northLatitudeDegrees,
int westLongitudeDegrees,
int eastLongitudeDegrees,
TerrainCacheGroup cacheGroup)
Initializes a new instance with the specified information.
|
NgaDigitalTerrainElevationData(String dmedFileName,
TerrainCacheGroup cacheGroup)
Initializes a new instance using the specified DMED filename.
|
Modifier and Type | Method and Description |
---|---|
TerrainCacheGroup |
getCacheGroup()
Gets the
TerrainCacheGroup that contains this provider. |
FirstPartialsOfHeight |
getFirstPartials(double longitude,
double latitude)
|
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.
|
double |
getMinimumSampleSpacing()
Gets the smallest distance between the successive height samples of the terrain data, in radians.
|
SecondPartialsOfHeight |
getSecondPartials(double longitude,
double latitude)
|
void |
preloadExtent(CartographicExtent extent)
Loads the terrain data in a given
CartographicExtent into the terrain cache. |
void |
unloadExtent(CartographicExtent extent)
Unloads the cached terrain data for a given
CartographicExtent . |
getBoundingExtent, getBoundingExtentNativeUnits, getGradient, getHeightReference, getHeightRelativeToShape, getHessian, getLocalMinimumSampleSpacing, getNativeToMeters, getNormal, getRadiansToNative, getReferenceSurface, getShape, getShapeFixedFrame, inGlobalBounds, setBoundingExtent, setBoundingExtentNativeUnits, setHeightReference, setNativeToMeters, setRadiansToNative, setReferenceSurface, setShape, setShapeFixedFrame
public NgaDigitalTerrainElevationData(@Nonnull String dmedFileName)
dmedFileName
- The full path and filename of the DMED file.IllegalStateException
- Thrown when the Earth
(get
) instance in the current
CalculationContext
is not configured with a mean sea level (MSL).InvalidDataException
- Thrown when the DMED file does not have the expected format.ArgumentNullException
- Thrown when dmedFileName
is null
.public NgaDigitalTerrainElevationData(@Nonnull String dmedFileName, @Nonnull TerrainCacheGroup cacheGroup)
dmedFileName
- The full path and filename of the DMED file.cacheGroup
- The cache group with which to associate this terrain provider.IllegalStateException
- Thrown when the Earth
(get
) instance in the current
CalculationContext
is not configured with a mean sea level (MSL).InvalidDataException
- Thrown when the DMED file does not have the expected format.ArgumentNullException
- Thrown when dmedFileName
or cacheGroup
is null
.public NgaDigitalTerrainElevationData(@Nonnull FileStreamFactory dmedFileStreamFactory)
dmedFileStreamFactory
- The factory to use to create streams to read the DMED file.IllegalStateException
- Thrown when the Earth
(get
) instance in the current
CalculationContext
is not configured with a mean sea level (MSL).InvalidDataException
- Thrown when the DMED file does not have the expected format, or the stream ends unexpectedly.ArgumentNullException
- Thrown when dmedFileStreamFactory
is null
.public NgaDigitalTerrainElevationData(@Nonnull FileStreamFactory dmedFileStreamFactory, @Nonnull TerrainCacheGroup cacheGroup)
dmedFileStreamFactory
- The factory to use to create streams to read the DMED file.cacheGroup
- The cache group with which to associate this terrain provider.IllegalStateException
- Thrown when the Earth
(get
) instance in the current
CalculationContext
is not configured with a mean sea level (MSL).InvalidDataException
- Thrown when the DMED file does not have the expected format, or the stream ends unexpectedly.ArgumentNullException
- Thrown when dmedFileStreamFactory
or cacheGroup
is null
.public NgaDigitalTerrainElevationData(@Nonnull String dtedDirectory, int southLatitudeDegrees, int northLatitudeDegrees, int westLongitudeDegrees, int eastLongitudeDegrees)
dtedDirectory
- The directory containing DTED files, with the expected directory structure, specifically,
subdirectories named HDDD, each containing cell files named HDD.dtN,
where H is the hemisphere, DDD is longitude degrees, DD is latitude degrees, and N is 0, 1, or 2.southLatitudeDegrees
- The south latitude of the bounding rectangle for the data set, in degrees,
with positive values representing latitudes in the northern hemisphere and negative values representing latitudes in the southern hemisphere.northLatitudeDegrees
- The north latitude of the bounding rectangle for the data set, in degrees,
with positive values representing latitudes in the northern hemisphere and negative values representing latitudes in the southern hemisphere.westLongitudeDegrees
- The west longitude of the bounding rectangle for the data set, in degrees,
with positive values representing longitudes in the eastern hemisphere and negative values representing longitudes in the western hemisphere.eastLongitudeDegrees
- The east longitude of the bounding rectangle for the data set, in degrees,
with positive values representing longitudes in the eastern hemisphere and negative values representing longitudes in the western hemisphere.IllegalStateException
- Thrown when the Earth
(get
) instance in the current
CalculationContext
is not configured with a mean sea level (MSL).ArgumentNullException
- Thrown when dtedDirectory
is null
.public NgaDigitalTerrainElevationData(@Nonnull String dtedDirectory, int southLatitudeDegrees, int northLatitudeDegrees, int westLongitudeDegrees, int eastLongitudeDegrees, @Nonnull TerrainCacheGroup cacheGroup)
cacheGroup
- The cache group with which to associate this terrain provider.dtedDirectory
- The directory containing DTED files, with the expected directory structure, specifically,
subdirectories named HDDD, each containing cell files named HDD.dtN,
where H is the hemisphere, DDD is longitude degrees, DD is latitude degrees, and N is 0, 1, or 2.southLatitudeDegrees
- The south latitude of the bounding rectangle for the data set, in degrees,
with positive values representing latitudes in the northern hemisphere and negative values representing latitudes in the southern hemisphere.northLatitudeDegrees
- The north latitude of the bounding rectangle for the data set, in degrees,
with positive values representing latitudes in the northern hemisphere and negative values representing latitudes in the southern hemisphere.westLongitudeDegrees
- The west longitude of the bounding rectangle for the data set, in degrees,
with positive values representing longitudes in the eastern hemisphere and negative values representing longitudes in the western hemisphere.eastLongitudeDegrees
- The east longitude of the bounding rectangle for the data set, in degrees,
with positive values representing longitudes in the eastern hemisphere and negative values representing longitudes in the western hemisphere.IllegalStateException
- Thrown when the Earth
(get
) instance in the current
CalculationContext
is not configured with a mean sea level (MSL).ArgumentNullException
- Thrown when dtedDirectory
or cacheGroup
is null
.@Nonnull public final TerrainCacheGroup getCacheGroup()
TerrainCacheGroup
that contains this provider.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 TerrainProvider
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 TerrainProvider
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.@Nonnull public FirstPartialsOfHeight getFirstPartials(double longitude, double latitude)
Shape
(get
/ set
).getFirstPartials
in class TerrainProvider
longitude
- The longitude, in radians.
Requesting derivatives for a longitude less than -π or greater than π will always return Double.NaN
.latitude
- The latitude, in radians.
Requesting derivatives for a latitude less than -π/2 or greater than π/2 will always return Double.NaN
.FirstPartialsOfHeight
with respect to longitude and latitude,
in meters of height per radian.@Nonnull public SecondPartialsOfHeight getSecondPartials(double longitude, double latitude)
Shape
(get
/ set
).getSecondPartials
in class TerrainProvider
longitude
- The longitude, in radians.
Requesting derivatives for a longitude less than -π or greater than π will always return Double.NaN
.latitude
- The latitude, in radians.
Requesting derivatives for a latitude less than -π/2 or greater than π/2 will always return Double.NaN
.SecondPartialsOfHeight
with respect to longitude and latitude,
in meters of height per radian squared.public void preloadExtent(CartographicExtent extent)
CartographicExtent
into the terrain cache.
This method does not return until the terrain data is fully loaded. All terrain data within the extent is loaded into
memory, even if doing so would exceed the TerrainCacheGroup's
MaximumSize
(get
/ set
). Furthermore, the loaded terrain data is locked
in memory (meaning it will not be unloaded) until the user calls NgaDigitalTerrainElevationData.unloadExtent(agi.foundation.coordinates.CartographicExtent)
.
This method is safe to call from any thread.preloadExtent
in class TerrainProvider
extent
- The extent for which to load terrain data, in radians.ArgumentNullException
- Thrown when extent
is null
.public void unloadExtent(CartographicExtent extent)
CartographicExtent
.
This method unloads all cached regions where any part of the region falls within
the extent. It does not return until the regions have been unloaded. However,
if a region within the extent is being used in another thread while this method
is executing, the region may be reloaded immediately after this method unloads it.
This method is safe to call from any thread.unloadExtent
in class TerrainProvider
extent
- The CartographicExtent
for which to unload terrain, in radians.ArgumentNullException
- Thrown when extent
is null
.public double getMinimumSampleSpacing()
getMinimumSampleSpacing
in class TerrainProvider