Closed iamtekson closed 8 months ago
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) /mnt/d/tek/sm/code/prediction_merge.ipynb Cell 20 line 1 ----> 1 gt.save_tiles(f'{PLACE_NAME}_S2_{YM}', prefix="tiles_") File ~/miniconda3/envs/tf212/lib/python3.9/site-packages/geotile/GeoTile.py:470, in GeoTile.save_tiles(self, output_folder, prefix, suffix, image_format, dtype) 467 meta.update({"count": wd.shape[0]}) 469 # save the tiles with new metadata --> 470 with rio.open(tile_path, "w", **meta) as outds: 471 outds.write(wd.astype(meta["dtype"])) File ~/miniconda3/envs/tf212/lib/python3.9/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 ~/miniconda3/envs/tf212/lib/python3.9/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, 316 mode, 317 driver=driver, 318 width=width, 319 height=height, 320 count=count, 321 crs=crs, 322 transform=transform, 323 dtype=dtype, 324 nodata=nodata, 325 sharing=sharing, 326 **kwargs 327 ) 328 else: 329 raise DriverCapabilityError( 330 "Writer does not exist for driver: %s" % str(driver) 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.