diff --git a/batch/python/gdal_utils.py b/batch/python/gdal_utils.py index fa498791..c3b0b8a1 100644 --- a/batch/python/gdal_utils.py +++ b/batch/python/gdal_utils.py @@ -66,3 +66,10 @@ def run_gdal_subcommand(cmd: List[str], env: Optional[Dict] = None) -> Tuple[str raise GDALError(e) return o, e + + +def from_gdal_data_type(data_type: str) -> str: + if data_type == "Byte": + return "uint8" + else: + return data_type.lower() diff --git a/batch/python/tiles_geojson.py b/batch/python/tiles_geojson.py index 9004f02a..653da89e 100644 --- a/batch/python/tiles_geojson.py +++ b/batch/python/tiles_geojson.py @@ -9,7 +9,7 @@ from shapely.ops import unary_union from errors import GDALError -from gdal_utils import run_gdal_subcommand +from gdal_utils import from_gdal_data_type, run_gdal_subcommand def to_4326(crs: CRS, x: float, y: float) -> Tuple[float, float]: @@ -26,7 +26,11 @@ def extract_metadata_from_gdalinfo(gdalinfo_json: Dict[str, Any]) -> Dict[str, A bands = [ { - "data_type": band.get("type", None), + "data_type": ( + from_gdal_data_type(band.get("type")) + if band.get("type") is not None + else None + ), "no_data": ( "nan" if ( band.get("noDataValue", None) is not None