Class Map.HeightProvider
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
Map
This class is thread safe. Related article: Retrieving height data. Related article: Retrieving height data.
- Since:
- 2023.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
finalize()
retrieveHeightAt
(Coordinate pixelCoordinate, boolean interpolate) Return an elevation value at a specified pixel that corresponds with what is visible on the map.retrieveHeightAt
(Point point, PixelDensity pixelDensity, boolean interpolate) Return an elevation value at the provided point at a provided pixel density.
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
retrieveHeightAt
Return an elevation value at a specified pixel that corresponds with what is visible on the map.The ´Map::HeightProvider´ loops over all the visible elevation raster model loaded on the map in a top to bottom fashion in search for elevation data. It Looks for the first model with a tile in the underlying raster data covering the specified pixel point. The pixel density used for the
retrieveHeightAt
call is based on the camera position and pixel queried. if elevation data is found it will be returned in the map reference unit of measure,null
otherwise.Using interpolation makes sure that neighbouring height values form a smoother curve.
- Remarks
- this method is thread safe, you can call it from any thread.
- Parameters:
pixelCoordinate
- The pixel for which the height is requested. in device independent pixels coordinate.interpolate
- bilinear interpolation is used if true, nearest neighbour if false. Enabling bilinear interpolation results in a smoother curve for neighboring samples, at the cost of a minor performance decrease.- Returns:
- the height expressed in the map reference unit of measure, or
null
if no data is available for this pixel coordinate.
-
retrieveHeightAt
@Nullable public Double retrieveHeightAt(@NotNull Point point, @NotNull PixelDensity pixelDensity, boolean interpolate) throws IllegalArgumentException Return an elevation value at the provided point at a provided pixel density.The Map::HeightProvider loops over all visible elevation raster models loaded on the map, from top to bottom, searching for the first model with a tile in the underlying raster data covering the specified point and with a pixel density equal or lower to the specified density. If elevation data is found, it is returned in the map reference unit of measure,
null
otherwise.Using interpolation makes sure that neighbouring height values form a smoother curve.
- Remarks
- this method is thread safe, you can call it from any thread.
- Parameters:
point
- the point for which the height is requested.pixelDensity
- the pixel density used to determine the level of detail to be used in the underlying data of each elevation model. Must be in the same coordinate reference of the provided point.interpolate
- bilinear interpolation is used if true, nearest neighbor if false.- Returns:
- the height expressed in the map reference unit of measure, or
null
if no data is available for this point. - Throws:
IllegalArgumentException
- when the provided point and pixel density have different coordinate reference systems.- Since:
- 2024.0
-