public class TerrainPostsInt32 extends TerrainPosts
RasterTerrainProvider where each
post is stored as an int.| Constructor and Description |
|---|
TerrainPostsInt32(RasterTerrainProvider provider,
RasterTerrainIndexExtent indexExtent,
int voidValue)
Initializes a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
get(int longitudeIndex,
int latitudeIndex)
Gets the post height at a particular set of indices.
|
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.
|
double |
getPostHeight(int longitudeIndex,
int latitudeIndex)
Gets the height at a post.
|
long |
getSize()
Gets the size of the post data, in bytes.
|
int |
getVoidValue()
Gets the integer value that indicates a void (or post with unknown height).
|
void |
set(int longitudeIndex,
int latitudeIndex,
int value)
Sets the post height at a particular set of indices.
|
getBoundingExtent, getFourSurroundingPosts, getIndexExtent, getTerrainProvider, indexToLatitude, indexToLongitude, latitudeToIndex, longitudeToIndexpublic TerrainPostsInt32(RasterTerrainProvider provider, @Nonnull RasterTerrainIndexExtent indexExtent, int voidValue)
provider - The terrain provider that provided this collection of posts.indexExtent - The extent of indices of this instance in the overall terrain provider.voidValue - The value that indicates a void (or post with unknown height).public void getFourPostHeights(int west,
int south,
int east,
int north,
@Nonnull
double[] southWest,
@Nonnull
double[] southEast,
@Nonnull
double[] northEast,
@Nonnull
double[] northWest)
getFourPostHeights in class TerrainPostswest - 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 int get(int longitudeIndex,
int latitudeIndex)
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.public final void set(int longitudeIndex,
int latitudeIndex,
int value)
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.public final int getVoidValue()
public long getSize()
getSize in class TerrainPostspublic double getPostHeight(int longitudeIndex,
int latitudeIndex)
In performance critical code, consider using TerrainPostsInt32.getFourPostHeights(int, int, int, int, double[], double[], double[], double[]) instead of calling this method four times.
Doing so will avoid unnecessary function call overhead.
getPostHeight in class TerrainPostslongitudeIndex - 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.