public interface Tile extends UpdatableTile
The elevations are considered to be at the center of each cells. The minimum latitude and longitude hence correspond to the center of the most South-West cell, and the maximum latitude and longitude correspond to the center of the most North-East cell.
Modifier and Type | Interface and Description |
---|---|
static class |
Tile.Location
Enumerate for point location with respect to the interpolation grid of a tile.
|
Modifier and Type | Method and Description |
---|---|
NormalizedGeodeticPoint |
cellIntersection(NormalizedGeodeticPoint p,
Vector3D los,
int latitudeIndex,
int longitudeIndex)
Find the intersection of a line-of-sight and a Digital Elevation Model cell.
|
double |
getElevationAtIndices(int latitudeIndex,
int longitudeIndex)
Get the elevation of an exact grid point.
|
int |
getFloorLatitudeIndex(double latitude)
Get the floor latitude index of a point.
|
int |
getFloorLongitudeIndex(double longitude)
Get the floor longitude index of a point.
|
double |
getLatitudeAtIndex(int latitudeIndex)
Get the latitude at some index.
|
int |
getLatitudeRows()
Get number of latitude rows.
|
double |
getLatitudeStep()
Get step in latitude (size of one raster element).
|
Tile.Location |
getLocation(double latitude,
double longitude)
Check if a tile covers a ground point.
|
double |
getLongitudeAtIndex(int longitudeIndex)
Get the longitude at some index.
|
int |
getLongitudeColumns()
Get number of longitude columns.
|
double |
getLongitudeStep()
Get step in longitude (size of one raster element).
|
double |
getMaxElevation()
Get the maximum elevation in the tile.
|
int |
getMaxElevationLatitudeIndex()
Get the latitude index of max elevation.
|
int |
getMaxElevationLongitudeIndex()
Get the longitude index of max elevation.
|
double |
getMaximumLatitude()
Get maximum latitude.
|
double |
getMaximumLongitude()
Get maximum longitude.
|
double |
getMinElevation()
Get the minimum elevation in the tile.
|
int |
getMinElevationLatitudeIndex()
Get the latitude index of min elevation.
|
int |
getMinElevationLongitudeIndex()
Get the longitude index of min elevation.
|
double |
getMinimumLatitude()
Get minimum latitude of grid interpolation points.
|
double |
getMinimumLongitude()
Get minimum longitude.
|
double |
interpolateElevation(double latitude,
double longitude)
Interpolate elevation.
|
void |
tileUpdateCompleted()
Hook called at the end of tile update completion.
|
setElevation, setGeometry
void tileUpdateCompleted()
double getMinimumLatitude()
double getLatitudeAtIndex(int latitudeIndex)
latitudeIndex
- latitude indexdouble getMaximumLatitude()
Beware that as a point at maximum latitude is the northernmost
one of the grid, it doesn't have a northwards neighbor and
therefore calling getLocation
on such a latitude will return either Tile.Location.NORTH_WEST
,
Tile.Location.NORTH
or Tile.Location.NORTH_EAST
, but can
never return Tile.Location.HAS_INTERPOLATION_NEIGHBORS
!
double getMinimumLongitude()
double getLongitudeAtIndex(int longitudeIndex)
longitudeIndex
- longitude indexdouble getMaximumLongitude()
Beware that as a point at maximum longitude is the easternmost
one of the grid, it doesn't have an eastwards neighbor and
therefore calling getLocation
on such a longitude will return either Tile.Location.SOUTH_EAST
,
Tile.Location.EAST
or Tile.Location.NORTH_EAST
, but can
never return Tile.Location.HAS_INTERPOLATION_NEIGHBORS
!
double getLatitudeStep()
double getLongitudeStep()
int getLatitudeRows()
int getLongitudeColumns()
int getFloorLatitudeIndex(double latitude)
The specified latitude is always between index and index+1.
latitude
- geodetic latitudeint getFloorLongitudeIndex(double longitude)
The specified longitude is always between index and index+1.
longitude
- geodetic longitudedouble getMinElevation()
int getMinElevationLatitudeIndex()
int getMinElevationLongitudeIndex()
double getMaxElevation()
int getMaxElevationLatitudeIndex()
int getMaxElevationLongitudeIndex()
double getElevationAtIndices(int latitudeIndex, int longitudeIndex)
latitudeIndex
- grid point index along latitudelongitudeIndex
- grid point index along longitudedouble interpolateElevation(double latitude, double longitude)
In order to cope with numerical accuracy issues when computing points at tile boundary, a slight tolerance (typically 1/8 cell) around the tile is allowed. Elevation can therefore be interpolated (really extrapolated in this case) even for points slightly overshooting tile boundaries, using the closest tile cell. Attempting to interpolate too far from the tile will trigger an exception.
latitude
- ground point latitudelongitude
- ground point longitudeNormalizedGeodeticPoint cellIntersection(NormalizedGeodeticPoint p, Vector3D los, int latitudeIndex, int longitudeIndex)
Beware that for continuity reasons, the point argument in cellIntersection
is normalized
with respect to other points used by the caller. This implies that the longitude may be
outside of the [-π ; +π] interval (or the [0 ; 2π] interval, depending on the DEM). In particular,
when a Line Of Sight crosses the antimeridian at ±π longitude, the library may call the
cellIntersection
method with a point having a longitude of -π-ε to ensure this continuity.
As tiles are stored with longitude clipped to a some DEM specific interval (either [-π ; +π] or [0 ; 2π]),
implementations MUST take care to clip the input point back to the tile interval using
MathUtils.normalizeAngle(p.getLongitude(),
someLongitudeWithinTheTile)
. The output point normalization should also be made consistent with
the current tile.
p
- point on the line (beware its longitude is not normalized with respect to tile)los
- line-of-sight, in the topocentric frame (East, North, Zenith) of the point,
scaled to match radians in the horizontal plane and meters along the vertical axislatitudeIndex
- latitude index of the Digital Elevation Model celllongitudeIndex
- longitude index of the Digital Elevation Model cellTile.Location getLocation(double latitude, double longitude)
latitude
- ground point latitudelongitude
- ground point longitudeCopyright © 2014-2023 CS GROUP. All rights reserved.