elevation.spatial ================= .. py:module:: elevation.spatial Attributes ---------- .. autoapisummary:: elevation.spatial.DEFAULT_GDAL_OPTIONS elevation.spatial.FLOAT_TILE_GDAL_OPTIONS elevation.spatial.INT_TILE_GDAL_OPTIONS elevation.spatial.TILE_GDAL_OPTIONS elevation.spatial.TOOLS elevation.spatial.VSICURL_PATTERN Functions --------- .. autoapisummary:: elevation.spatial.call_gdal_translate elevation.spatial.call_gdalbuildvrt elevation.spatial.gdal_json elevation.spatial.import_bounds elevation.spatial.is_not_found elevation.spatial.raster_bounds elevation.spatial.selfcheck elevation.spatial.vector_bounds Module Contents --------------- .. py:function:: call_gdal_translate(source, destination, options = DEFAULT_GDAL_OPTIONS, empty_on_notfound = False) Write *source* to *destination* calling the gdal_translate binary. :param source: Any GDAL readable raster, local or remote. :param destination: Path of the destination, parent folders are created. :param options: GDAL creation options, the default is good for caching tiles. :param empty_on_notfound: Write an empty *destination* if the remote *source* is a 404. .. py:function:: call_gdalbuildvrt(sources, destination, options = DEFAULT_GDAL_OPTIONS) Build the *destination* ``.vrt`` mosaic over *sources*. :param sources: Paths of the raster tiles to mosaic. :param destination: Path of the destination, parent folders are created. :param options: GDAL options placed before the destination. .. py:function:: gdal_json(cmd, destination) Run the *cmd* GDAL command on *destination* and return its JSON report. .. py:function:: 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. :param reference: Path or connection string of a GDAL or OGR data source. :return: Bounds in 'left bottom right top' order. :raises RuntimeError: If *reference* cannot be opened. .. py:function:: is_not_found(url) Return whether the HTTP server answers 404 for *url*. .. py:function:: raster_bounds(reference) Return the bounds of the raster *reference*, ``None`` if it is not a raster. .. py:function:: selfcheck(tools = TOOLS, verbose = False) Audit the system for issues. :param tools: Tools description, defaults to TOOLS. :param verbose: Report each tool as it is tested. .. py:function:: vector_bounds(reference) Return the bounds of the vector *reference*, ``None`` if it is not a vector. .. py:data:: DEFAULT_GDAL_OPTIONS :value: '-q' .. py:data:: FLOAT_TILE_GDAL_OPTIONS :value: '-q -co TILED=YES -co COMPRESS=DEFLATE -co ZLEVEL=9 -co NUM_THREADS=ALL_CPUS --config... .. py:data:: INT_TILE_GDAL_OPTIONS :value: '-q -co TILED=YES -co COMPRESS=DEFLATE -co ZLEVEL=9 -co NUM_THREADS=ALL_CPUS --config... .. py:data:: TILE_GDAL_OPTIONS :value: '-q -co TILED=YES -co COMPRESS=DEFLATE -co ZLEVEL=9 -co NUM_THREADS=ALL_CPUS --config... .. py:data:: TOOLS :type: list[tuple[str, str]] :value: [('gdal_translate', 'gdal_translate --version'), ('gdalbuildvrt', 'gdalbuildvrt --version'),... .. py:data:: VSICURL_PATTERN