public abstract class TerrainPosts extends Object
RasterTerrainProvider
.Modifier | Constructor and Description |
---|---|
protected |
TerrainPosts(RasterTerrainProvider provider,
RasterTerrainIndexExtent indexExtent)
Initializes a new instance.
|
Modifier and Type | Method and Description |
---|---|
CartographicExtent |
getBoundingExtent()
Gets the bounding extent of the posts stored by this instance.
|
abstract void |
getFourPostHeights(int west,
int south,
int east,
int north,
double[] southWest,
double[] southEast,
double[] northEast,
double[] northWest)
Gets the heights of four posts, specified by index.
|
void |
getFourSurroundingPosts(double longitude,
double latitude,
int[] west,
int[] south,
int[] east,
int[] north)
Gets the indices of the four posts surrounding a given longitude and latitude point.
|
RasterTerrainIndexExtent |
getIndexExtent()
Gets the extent of indices of this instance in the overall terrain provider.
|
abstract double |
getPostHeight(int longitudeIndex,
int latitudeIndex)
Gets the height at a post.
|
abstract long |
getSize()
Gets the size of the post data, in bytes.
|
RasterTerrainProvider |
getTerrainProvider()
Gets the terrain provider that provided this collection of posts.
|
double |
indexToLatitude(int index)
Gets the latitude of the post at a specified index.
|
double |
indexToLongitude(int index)
Gets the longitude 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.
|
protected TerrainPosts(RasterTerrainProvider provider, @Nonnull RasterTerrainIndexExtent indexExtent)
provider
- The terrain provider that provided this collection of posts.indexExtent
- The extent of indices of this instance in the overall terrain provider.public final RasterTerrainProvider getTerrainProvider()
@Nonnull public final RasterTerrainIndexExtent getIndexExtent()
public final CartographicExtent getBoundingExtent()
public abstract long getSize()
public abstract double getPostHeight(int longitudeIndex, int latitudeIndex)
In performance critical code, consider using TerrainPosts.getFourPostHeights(int, int, int, int, double[], double[], double[], double[])
instead of calling this method four times.
Doing so will avoid unnecessary function call overhead.
longitudeIndex
- The longitude index of the post. 0 refers to the western-most post stored by this instance.latitudeIndex
- The latitude index of the post. 0 refers to the southern-most post stored by this instance.IndexOutOfBoundsException
- Thrown when longitudeIndex
or latitudeIndex
is outside the extent
of this collection of posts.public abstract void getFourPostHeights(int west, int south, int east, int north, @Nonnull double[] southWest, @Nonnull double[] southEast, @Nonnull double[] northEast, @Nonnull double[] northWest)
west
- The index of the two western posts. 0 refers to western-most post stored by this instance.south
- The index of the two southern posts. 0 refers to southern-most post stored by this instance.east
- The index of the two eastern posts. 0 refers to western-most post stored by this instance.north
- The index of the two northern posts. 0 refers to southern-most post stored by this instance.southWest
- On input, an array with one element. On return, the array is populated with
the height of the southwest post, in the native units of the terrain provider.southEast
- On input, an array with one element. On return, the array is populated with
the height of the southeast post, in the native units of the terrain provider.northEast
- On input, an array with one element. On return, the array is populated with
the height of the northeast post, in the native units of the terrain provider.northWest
- On input, an array with one element. On return, the array is populated with
the height of the northwest post, in the native units of the terrain provider.IndexOutOfBoundsException
- Thrown when an index is outside the extent of this collection of posts.public final void getFourSurroundingPosts(double longitude, double latitude, @Nonnull int[] west, @Nonnull int[] south, @Nonnull int[] east, @Nonnull int[] north)
longitude
- The longitude, in the native units of the terrain provider.latitude
- The latitude, in the native units of the terrain provider.west
- On input, an array with one element. On return, the array is populated with
the index of the posts to the west of the point. 0 refers to the western-most post stored by this instance.south
- On input, an array with one element. On return, the array is populated with
the index of the posts to the south of the point. 0 refers to the southern-most post stored by this instance.east
- On input, an array with one element. On return, the array is populated with
the index of the posts to the east of the point. 0 refers to the western-most post stored by this instance.north
- On input, an array with one element. On return, the array is populated with
the index of the posts to the north of the point. 0 refers to the southern-most post stored by this instance.public final double indexToLongitude(int index)
index
- The index. 0 refers to the western-most post stored by this instance.public final double indexToLatitude(int index)
index
- The index. 0 refers to the southern-most post stored by this instance.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.