elevation.spatial#
Attributes#
Functions#
|
Write source to destination calling the gdal_translate binary. |
|
Build the destination |
|
Run the cmd GDAL command on destination and return its JSON report. |
|
Return the bounds of reference, a raster or vector data source. |
|
Return whether the HTTP server answers 404 for url. |
|
Return the bounds of the raster reference, |
|
Audit the system for issues. |
|
Return the bounds of the vector reference, |
Module Contents#
- elevation.spatial.call_gdal_translate(source, destination, options=DEFAULT_GDAL_OPTIONS, empty_on_notfound=False)#
Write source to destination calling the gdal_translate binary.
- Parameters:
source – Any GDAL readable raster, local or remote.
destination – Path of the destination, parent folders are created.
options – GDAL creation options, the default is good for caching tiles.
empty_on_notfound – Write an empty destination if the remote source is a 404.
- elevation.spatial.call_gdalbuildvrt(sources, destination, options=DEFAULT_GDAL_OPTIONS)#
Build the destination
.vrtmosaic over sources.- Parameters:
sources – Paths of the raster tiles to mosaic.
destination – Path of the destination, parent folders are created.
options – GDAL options placed before the destination.
- elevation.spatial.gdal_json(cmd, destination)#
Run the cmd GDAL command on destination and return its JSON report.
- elevation.spatial.import_bounds(reference)#
Return the bounds of reference, a raster or vector data source.
The bounds are read with the GDAL command line tools, from the first data source that can open reference, in the crs of the data source.
- Parameters:
reference – Path or connection string of a GDAL or OGR data source.
- Returns:
Bounds in ‘left bottom right top’ order.
- Raises:
RuntimeError – If reference cannot be opened.
- elevation.spatial.is_not_found(url)#
Return whether the HTTP server answers 404 for url.
- elevation.spatial.raster_bounds(reference)#
Return the bounds of the raster reference,
Noneif it is not a raster.
- elevation.spatial.selfcheck(tools=TOOLS, verbose=False)#
Audit the system for issues.
- Parameters:
tools – Tools description, defaults to TOOLS.
verbose – Report each tool as it is tested.
- elevation.spatial.vector_bounds(reference)#
Return the bounds of the vector reference,
Noneif it is not a vector.
- elevation.spatial.DEFAULT_GDAL_OPTIONS = '-q'#
- elevation.spatial.FLOAT_TILE_GDAL_OPTIONS = '-q -co TILED=YES -co COMPRESS=DEFLATE -co ZLEVEL=9 -co NUM_THREADS=ALL_CPUS -co PREDICTOR=3'#
- elevation.spatial.INT_TILE_GDAL_OPTIONS = '-q -co TILED=YES -co COMPRESS=DEFLATE -co ZLEVEL=9 -co NUM_THREADS=ALL_CPUS -co PREDICTOR=2'#
- elevation.spatial.TILE_GDAL_OPTIONS = '-q -co TILED=YES -co COMPRESS=DEFLATE -co ZLEVEL=9 -co NUM_THREADS=ALL_CPUS'#
- elevation.spatial.TOOLS: list[tuple[str, str]] = [('gdal_translate', 'gdal_translate --version'), ('gdalbuildvrt', 'gdalbuildvrt --version'),...#
- elevation.spatial.VSICURL_PATTERN#