aws.osml.photogrammetry.digital_elevation_model module
- class aws.osml.photogrammetry.digital_elevation_model.DigitalElevationModelTileSet[source]
Bases:
ABCThis class defines an abstraction that is capable of identifying which elevation tile in a DEM contains the elevations for a given world coordinate. It is common to split a DEM with global coverage up into a collection of files with well understood coverage areas. Those files may follow a simple naming convention but could be cataloged in an external spatial index. This class abstracts those details away from the DigitalElevationModel allowing us to easily extend this design to various tile sets.
- Returns:
None
- abstract find_tile_id(geodetic_world_coordinate: GeodeticWorldCoordinate) str | None[source]
Converts the latitude, longitude of the world coordinate into a tile path.
- Parameters:
geodetic_world_coordinate – GeodeticWorldCoordinate = the world coordinate of interest
- Returns:
the tile path or None if the DEM does not have coverage for this location
- class aws.osml.photogrammetry.digital_elevation_model.DigitalElevationModelTileFactory[source]
Bases:
ABCThis class defines an abstraction that is able to load a tile and convert it to a Numpy array of elevation data along with a SensorModel that can be used to identify the grid locations associated with a latitude, longitude.
- Returns:
None
- abstract get_tile(tile_path: str) Tuple[Any | None, SensorModel | None, ElevationRegionSummary | None][source]
Retrieve a numpy array of elevation values and a sensor model.
TODO: Replace Any with numpy.typing.ArrayLike once we move to numpy >1.20
- Parameters:
tile_path – the location of the tile to load
- Returns:
an array of elevation values, a sensor model, and a summary
- class aws.osml.photogrammetry.digital_elevation_model.DigitalElevationModel(tile_set: DigitalElevationModelTileSet, tile_factory: DigitalElevationModelTileFactory, raster_cache_size: int = 10, propagate_nans: bool = True)[source]
Bases:
ElevationModelA Digital Elevation Model (DEM) is a representation of the topographic surface of the Earth. Theoretically these representations exclude trees, buildings, and any other surface objects but in practice elevations from those objects are likely captured by the sensors use to capture the elevation data.
These datasets are normally stored as a pre-tiled collection of images with a well established resolution and coverage.
- raster_cache: LRUCache
- set_elevation(geodetic_world_coordinate: GeodeticWorldCoordinate) bool[source]
This method updates the elevation component of a geodetic world coordinate to match the surface elevation at the provided latitude and longitude. Note that if the DEM does not have elevation values for this region or if there is an error loading the associated image the elevation will be unchanged.
- Parameters:
geodetic_world_coordinate – the coordinate to update
- Returns:
True if the elevation was updated, else False
- describe_region(geodetic_world_coordinate: GeodeticWorldCoordinate) ElevationRegionSummary | None[source]
Get a summary of the region near the provided world coordinate
- Parameters:
geodetic_world_coordinate – the coordinate at the center of the region of interest
- Returns:
a summary of the elevation data in this tile