lidario.MetadataReader¶
Open a raster (.tif) or a rasterio.mask and return the metadata as a dictionary. See the examples for more details about how to use this class.
-
class
lidario.
MetadataReader
(input_type)[source]¶ Instantiate a MetadataReader object which will handle the metadata retrieval from the given input.
- Parameters
input_type (str) –
Type of raster data provided: “geotiff” or “mask”.
”geotiff”: a .tif raster file.
”mask”, a rasterio.mask.mask() result.
-
get_metadata
(input_values)[source]¶ Retrieve and return the metadata from a given “input_values”.
- Parameters
input_values –
Data values to translate. Depend on the Translator’s “input_type” parameter:
For a “geotiff”: Takes the path to your .tif file (string).
For a “mask”: Takes the np.array returned by a rasterio.mask.mask() method.
- Returns
A dictionary of the metadata.
- Return type
dict