osgeonepal / geotile

GeoTile is the python library for tiling the geographic raster data (eg. Tiff etc)
https://geotile.readthedocs.io
MIT License
74 stars 9 forks source link

Rasterization issue: ValueError: Given nodata value, nan, is beyond the valid range of its data type, uint8. #39

Closed iamtekson closed 11 months ago

iamtekson commented 11 months ago
File [.conda\envs\gee\lib\site-packages\geotile\GeoTile.py:605](file://.conda/envs/gee/lib/site-packages/geotile/GeoTile.py:605), in GeoTile.rasterization(self, input_vector, out_path, value_col, **kwargs)
    602 meta.update({'count': 1, "dtype": "uint8"})
    604 # write the output raster
--> 605 with rio.open(out_path, 'w', **meta) as outds:
    606     outds.write(mask)

File [.conda\envs\gee\lib\site-packages\rasterio\env.py:451](file://.conda/envs/gee/lib/site-packages/rasterio/env.py:451), in ensure_env_with_credentials.<locals>.wrapper(*args, **kwds)
    448     session = DummySession()
    450 with env_ctor(session=session):
--> 451     return f(*args, **kwds)

File [.conda\envs\gee\lib\site-packages\rasterio\__init__.py:314](file://.conda/envs/gee/lib/site-packages/rasterio/__init__.py:314), in open(fp, mode, driver, width, height, count, crs, transform, dtype, nodata, sharing, **kwargs)
    312 writer = get_writer_for_driver(driver)
    313 if writer is not None:
--> 314     dataset = writer(
    315         path,
...
    331     )

File rasterio\_io.pyx:1502, in rasterio._io.DatasetWriterBase.__init__()

ValueError: Given nodata value, nan, is beyond the valid range of its data type, uint8.