Class RasterModelHeightProvider
- All Implemented Interfaces:
AutoCloseable
This class is thread-safe.
Related article: Retrieving height data.
- Since:
- 2023.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanprotected voidfinalize()Returns the coordinate reference of this height provider.inthashCode()booleanReturns whether (bilinear) interpolation is used when calculating height values form the source data.Returns a newRasterModelHeightProviderbuilder.retrieveHeightAt(Coordinate coordinate, double pixelDensity) Retrieve the height data at the provided point at a provided pixel density.retrieveHeightAt(Coordinate coordinate, PixelDensity pixelDensity) Retrieve the height data at the provided point at a provided pixel density.voidsetInterpolate(boolean interpolate) Sets whether (bilinear) interpolation is used when calculating height values form the source data.
-
Constructor Details
-
RasterModelHeightProvider
-
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
newBuilder
Returns a newRasterModelHeightProviderbuilder.- Returns:
- a new
RasterModelHeightProviderbuilder.
-
retrieveHeightAt
@Nullable public Double retrieveHeightAt(@NotNull Coordinate coordinate, @NotNull PixelDensity pixelDensity) Retrieve the height data at the provided point at a provided pixel density.Looks for a tile in the underlying raster data covering the specified point and with a pixel density equal or lower to the specified density, and returns elevation data based on that tile. If several tiles match, then the most detailed tile is used; if all tiles covering the point have a density higher than requested density, then the least detailed tile is used.
- Parameters:
coordinate- The point for which the height is requested, expressed in thecoordinate referenceof the height provider. If the height provider reference is a 2D reference, Z-value is ignored.pixelDensity- The pixel density used to determine the level of detail to use in the underlying data. Must be in thecoordinate referenceof the height provider.- Returns:
- the height expressed in the reference of the height provider, or
nullif no data is available for this coordinate.
-
retrieveHeightAt
Retrieve the height data at the provided point at a provided pixel density.Looks for a tile in the underlying raster data covering the specified point and with a pixel density equal or lower to the specified density, and returns elevation data based on that tile. If several tiles match, then the most detailed tile is used; if all tiles covering the point have a density higher than requested density, then the least detailed tile is used.
- Parameters:
coordinate- The point for which the height is requested, expressed in thecoordinate referenceof the height provider. If the height provider reference is a 2D reference, Z-value is ignored.pixelDensity- The pixel density used to determine the level of detail to use in the underlying data. Assumed to be in thecoordinate referenceof the height provider.- Returns:
- the height expressed in the reference of the height provider, or
nullif no data is available for this coordinate.
-
getReference
Returns the coordinate reference of this height provider.The input and output of
retrieveHeightAtare all expressed in this reference.- Returns:
- the coordinate reference of this height provider.
-
isInterpolate
public boolean isInterpolate()Returns whether (bilinear) interpolation is used when calculating height values form the source data.- Returns:
- whether (bilinear) interpolation is used when calculating height values form the source data.
-
setInterpolate
public void setInterpolate(boolean interpolate) Sets whether (bilinear) interpolation is used when calculating height values form the source data.Using interpolation makes sure that neighbouring height values form a smoother curve.
- Parameters:
interpolate- whether interpolation is used
-
hashCode
public int hashCode() -
equals
-