public abstract class RasterTerrainProvider extends TerrainProvider
Modifier | Constructor and Description |
---|---|
protected |
RasterTerrainProvider()
Initializes a new instance as a member of the default
TerrainCacheGroup . |
protected |
RasterTerrainProvider(TerrainCacheGroup cacheGroup)
Initializes a new instance.
|
Modifier and Type | Method and Description |
---|---|
RasterTerrainIndexExtent |
cartographicExtentToIndexExtent(double westLongitude,
double southLatitude,
double eastLongitude,
double northLatitude)
Gets the post indices corresponding to a given cartographic extent.
|
RasterTerrainCache |
getCache()
Gets the cache for this terrain provider.
|
RasterTerrainInterpolator |
getDefaultInterpolator()
Gets the default interpolator to use to interpolate heights
when a specific interpolator is not specified in the call to
RasterTerrainProvider.getHeight(double,double)
or RasterTerrainProvider.getHeightNativeUnits(double,double) . |
double |
getDeltaLatitude()
Gets the distance between each post in the latitude direction, in radians.
|
double |
getDeltaLatitudeNativeUnits()
Gets the distance between each post in the latitude direction, in the native units of the provider.
|
double |
getDeltaLongitude()
Gets the distance between each post in the longitude direction, in radians.
|
double |
getDeltaLongitudeNativeUnits()
Gets the distance between each post in the longitude direction, in the native units of the provider.
|
double |
getEasternPostOffsetNativeUnits()
Gets the longitude offset (from the east) of the eastern-most post in the terrain provider.
|
FirstPartialsOfHeight |
getFirstPartials(double longitude,
double latitude)
|
FirstPartialsOfHeight |
getFirstPartials(double longitude,
double latitude,
RasterTerrainInterpolator interpolator)
|
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 |
getHeight(double longitude,
double latitude,
RasterTerrainInterpolator interpolator)
Gets the interpolated height of the terrain at the specified longitude and latitude using the
specified
TerrainInterpolator . |
double |
getHeightNativeUnits(double longitude,
double latitude)
Gets the interpolated height of the terrain at the specified longitude and latitude.
|
double |
getHeightNativeUnits(double longitude,
double latitude,
RasterTerrainInterpolator interpolator)
Gets the interpolated height of the terrain at the specified longitude and latitude.
|
double |
getHeightRelativeToShape(double longitude,
double latitude,
RasterTerrainInterpolator interpolator)
|
int |
getLatitudePosts()
Gets the number of posts in the latitude direction.
|
int |
getLongitudePosts()
Gets the number of posts in the longitude direction.
|
double |
getMinimumSampleSpacing()
Gets the smallest distance between the successive height samples of the terrain data, in radians.
|
protected boolean |
getNeedsSpecialCoordinateProcessing()
Gets a value indicating whether or not special processing of longitude and latitude coordinates
is required by this terrain provider.
|
double |
getNorthernPostOffsetNativeUnits()
Gets the latitude offset (from the north) of the northern-most post in the terrain provider.
|
abstract TerrainPosts |
getPosts(RasterTerrainIndexExtent extent)
Gets the posts over a specified area by reading them from the terrain data source.
|
SecondPartialsOfHeight |
getSecondPartials(double longitude,
double latitude)
|
SecondPartialsOfHeight |
getSecondPartials(double longitude,
double latitude,
RasterTerrainInterpolator interpolator)
|
double |
getSouthernPostOffsetNativeUnits()
Gets the latitude offset (toward the north) of the southern-most post in the terrain provider.
|
double |
getWesternPostOffsetNativeUnits()
Gets the longitude offset (toward the east) of the western-most post in the terrain provider.
|
double |
indexToLatitude(int index)
Gets the latitude, in native units, of the post at a specified index.
|
double |
indexToLongitude(int index)
Gets the longitude, in native units, of the post at a specified index.
|
int |
latitudeToIndex(double latitude)
Gets the index of the post at or immediately to the south of the specified latitude.
|
int |
longitudeToIndex(double longitude)
Gets the index of the post at or immediately to the west of the specified longitude.
|
void |
preloadExtent(CartographicExtent extent)
Loads the terrain data in a given
CartographicExtent into the terrain cache. |
protected void |
processCoordinates(double[] longitude,
double[] latitude)
Performs any additional processing of coordinate values prior to using them to load sets of posts
or for interpolating heights.
|
void |
setDefaultInterpolator(RasterTerrainInterpolator value)
Sets the default interpolator to use to interpolate heights
when a specific interpolator is not specified in the call to
RasterTerrainProvider.getHeight(double,double)
or RasterTerrainProvider.getHeightNativeUnits(double,double) . |
protected void |
setDeltaLatitude(double value)
Sets the distance between each post in the latitude direction, in radians.
|
protected void |
setDeltaLatitudeNativeUnits(double value)
Sets the distance between each post in the latitude direction, in the native units of the provider.
|
protected void |
setDeltaLongitude(double value)
Sets the distance between each post in the longitude direction, in radians.
|
protected void |
setDeltaLongitudeNativeUnits(double value)
Sets the distance between each post in the longitude direction, in the native units of the provider.
|
protected void |
setEasternPostOffsetNativeUnits(double value)
Sets the longitude offset (from the east) of the eastern-most post in the terrain provider.
|
protected void |
setLatitudePosts(int value)
Sets the number of posts in the latitude direction.
|
protected void |
setLongitudePosts(int value)
Sets the number of posts in the longitude direction.
|
protected void |
setNeedsSpecialCoordinateProcessing(boolean value)
Sets a value indicating whether or not special processing of longitude and latitude coordinates
is required by this terrain provider.
|
protected void |
setNorthernPostOffsetNativeUnits(double value)
Sets the latitude offset (from the north) of the northern-most post in the terrain provider.
|
protected void |
setSouthernPostOffsetNativeUnits(double value)
Sets the latitude offset (toward the north) of the southern-most post in the terrain provider.
|
protected void |
setWesternPostOffsetNativeUnits(double value)
Sets the longitude offset (toward the east) of the western-most post in the terrain provider.
|
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
protected RasterTerrainProvider()
TerrainCacheGroup
.protected RasterTerrainProvider(@Nonnull TerrainCacheGroup cacheGroup)
cacheGroup
- The cache group of which this provider is a member.ArgumentNullException
- Thrown when cacheGroup
is null
.@Nonnull public final RasterTerrainCache getCache()
public final RasterTerrainInterpolator getDefaultInterpolator()
RasterTerrainProvider.getHeight(double,double)
or RasterTerrainProvider.getHeightNativeUnits(double,double)
.public final void setDefaultInterpolator(RasterTerrainInterpolator value)
RasterTerrainProvider.getHeight(double,double)
or RasterTerrainProvider.getHeightNativeUnits(double,double)
.public double getMinimumSampleSpacing()
getMinimumSampleSpacing
in class TerrainProvider
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 final double getHeight(double longitude, double latitude, RasterTerrainInterpolator interpolator)
TerrainInterpolator
.
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.
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
.interpolator
- The RasterTerrainInterpolator
to use to interpolate heights for points that do not fall precisely on a post.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.public final double getHeightNativeUnits(double longitude, double latitude, RasterTerrainInterpolator interpolator)
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.
longitude
- The longitude, in the native units of the terrain provider.latitude
- The latitude, in the native units of the terrain provider.interpolator
- The RasterTerrainInterpolator
to use to interpolate heights for points that do not fall precisely on a post.Double.NaN
if the height is not available at the requested longitude and latitude.public final double getHeightRelativeToShape(double longitude, double latitude, RasterTerrainInterpolator interpolator)
Shape
(get
/ set
).
This method takes into account the heights of any reference surfaces.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
.interpolator
- The RasterTerrainInterpolator
to use to interpolate heights for points that do not fall precisely on a post.Shape
(get
/ set
), in meters.IllegalStateException
- Thrown when any reference surface does not have the same
Shape
(get
/ set
) and ShapeFixedFrame
(get
/ set
) as this terrain provider.@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 final FirstPartialsOfHeight getFirstPartials(double longitude, double latitude, RasterTerrainInterpolator interpolator)
Shape
(get
/ set
).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
.interpolator
- The interpolator to use when computing the value of the partial derivatives inside the boundary.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.@Nonnull public final SecondPartialsOfHeight getSecondPartials(double longitude, double latitude, RasterTerrainInterpolator interpolator)
Shape
(get
/ set
).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
.interpolator
- The interpolator to use when computing the value of the partial derivatives inside the boundary.SecondPartialsOfHeight
with respect to longitude and latitude,
in meters of height per radian squared.public final double getDeltaLongitude()
protected final void setDeltaLongitude(double value)
public final double getDeltaLongitudeNativeUnits()
protected final void setDeltaLongitudeNativeUnits(double value)
public final double getDeltaLatitude()
protected final void setDeltaLatitude(double value)
public final double getDeltaLatitudeNativeUnits()
protected final void setDeltaLatitudeNativeUnits(double value)
public final int getLongitudePosts()
protected final void setLongitudePosts(int value)
public final int getLatitudePosts()
protected final void setLatitudePosts(int value)
public final double getWesternPostOffsetNativeUnits()
protected final void setWesternPostOffsetNativeUnits(double value)
public final double getSouthernPostOffsetNativeUnits()
protected final void setSouthernPostOffsetNativeUnits(double value)
public final double getEasternPostOffsetNativeUnits()
protected final void setEasternPostOffsetNativeUnits(double value)
public final double getNorthernPostOffsetNativeUnits()
protected final void setNorthernPostOffsetNativeUnits(double value)
@Nonnull public abstract TerrainPosts getPosts(@Nonnull RasterTerrainIndexExtent extent)
extent
- The extent of the posts to read.public final double indexToLongitude(int index)
index
- The index.public final double indexToLatitude(int index)
index
- The index.public final int longitudeToIndex(double longitude)
longitude
- The longitude in the native units of the terrain provider.public final int latitudeToIndex(double latitude)
latitude
- The latitude in the native units of the terrain provider.@Nonnull public final RasterTerrainIndexExtent cartographicExtentToIndexExtent(double westLongitude, double southLatitude, double eastLongitude, double northLatitude)
westLongitude
- The western boundary of the extent, in the provider's native units.southLatitude
- The southern boundary of the extent, in the provider's native units.eastLongitude
- The eastern boundary of the extent, in the provider's native units.northLatitude
- The northern boundary of the extent, in the provider's native units.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 RasterTerrainProvider.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
.protected final boolean getNeedsSpecialCoordinateProcessing()
true
,
RasterTerrainProvider.getHeightNativeUnits(double,double,RasterTerrainInterpolator)
will call RasterTerrainProvider.processCoordinates(double[], double[])
before using the coordinates to load sets of posts or interpolate heights.protected final void setNeedsSpecialCoordinateProcessing(boolean value)
true
,
RasterTerrainProvider.getHeightNativeUnits(double,double,RasterTerrainInterpolator)
will call RasterTerrainProvider.processCoordinates(double[], double[])
before using the coordinates to load sets of posts or interpolate heights.protected void processCoordinates(@Nonnull double[] longitude, @Nonnull double[] latitude)
NeedsSpecialCoordinateProcessing
(get
/ set
)
is true
.longitude
- The longitude in the native units of the terrain provider.latitude
- The latitude in the native units of the terrain provider.