From 87073498a570c4f15fc8ae307ead9914fbee8f5c Mon Sep 17 00:00:00 2001 From: Cayetano Benavent Date: Thu, 21 Nov 2024 12:42:21 +0100 Subject: [PATCH] nodata - default for byte changed (#155) --- .gitignore | 1 + raster_loader/io/common.py | 2 +- raster_loader/tests/bigquery/test_io.py | 8 ++++---- raster_loader/tests/snowflake/test_io.py | 8 ++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index a0905f7..99a81f2 100644 --- a/.gitignore +++ b/.gitignore @@ -167,6 +167,7 @@ cython_debug/ # Custom carto_credentials.json +raster_loader/tests/fixtures/*.tif.aux.xml # written by setuptools_scm */_version.py diff --git a/raster_loader/io/common.py b/raster_loader/io/common.py index 142abf0..bb01296 100644 --- a/raster_loader/io/common.py +++ b/raster_loader/io/common.py @@ -27,7 +27,7 @@ "int16": -32768, "int32": -2147483648, "int64": -9223372036854775808, - "uint8": 255, + "uint8": 0, "uint16": 65535, "uint32": 4294967295, "uint64": 18446744073709551615, diff --git a/raster_loader/tests/bigquery/test_io.py b/raster_loader/tests/bigquery/test_io.py index 88d01f3..44cf222 100644 --- a/raster_loader/tests/bigquery/test_io.py +++ b/raster_loader/tests/bigquery/test_io.py @@ -461,7 +461,7 @@ def test_rasterio_to_table_overwrite(*args, **kwargs): return_value={ "bounds": [0, 0, 0, 0], "block_resolution": 5, - "nodata": 255, + "nodata": 0, "block_width": 256, "block_height": 256, "bands": [ @@ -482,7 +482,7 @@ def test_rasterio_to_table_overwrite(*args, **kwargs): "version": "0.0.3", }, 'colorinterp': 'red', - 'nodata': '255', + 'nodata': '0', 'colortable': None, } ], @@ -628,7 +628,7 @@ def test_rasterio_to_table_invalid_raster(*args, **kwargs): return_value={ "bounds": [0, 0, 0, 0], "block_resolution": 5, - "nodata": 255, + "nodata": 0, "block_width": 256, "block_height": 256, "bands": [ @@ -649,7 +649,7 @@ def test_rasterio_to_table_invalid_raster(*args, **kwargs): "version": "0.0.3", }, 'colorinterp': 'red', - 'nodata': '255', + 'nodata': '0', 'colortable': None, } ], diff --git a/raster_loader/tests/snowflake/test_io.py b/raster_loader/tests/snowflake/test_io.py index 3586b2f..4803eb2 100644 --- a/raster_loader/tests/snowflake/test_io.py +++ b/raster_loader/tests/snowflake/test_io.py @@ -439,7 +439,7 @@ def test_rasterio_to_table_overwrite(*args, **kwargs): return_value={ "bounds": [0, 0, 0, 0], "block_resolution": 5, - "nodata": 255, + "nodata": 0, "block_width": 256, "block_height": 256, "bands": [ @@ -459,7 +459,7 @@ def test_rasterio_to_table_overwrite(*args, **kwargs): "top_values": [1, 2, 3], "version": "0.0.3", }, - "nodata": "255", + "nodata": "0", "colorinterp": 'red', "colortable": None, } @@ -606,7 +606,7 @@ def test_rasterio_to_table_invalid_raster(*args, **kwargs): return_value={ "bounds": [0, 0, 0, 0], "block_resolution": 5, - "nodata": 255, + "nodata": 0, "block_width": 256, "block_height": 256, "bands": [ @@ -626,7 +626,7 @@ def test_rasterio_to_table_invalid_raster(*args, **kwargs): "top_values": [1, 2, 3], "version": "0.0.3", }, - "nodata": "255", + "nodata": "0", "colorinterp": 'red', "colortable": None, }