Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Given nodata value, -32768.0, is beyond the valid range of its data type, uint8. #68

Closed
iamtekson opened this issue Dec 21, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@iamtekson
Copy link
Member

This error message is similar to #64 and #56. I think, we need to pass the nodata as a parameter.

File ~/miniconda3/envs/tf212/lib/python3.9/site-packages/geotile/GeoTile.py:476, in GeoTile.save_tiles(self, output_folder, prefix, suffix, image_format, dtype)
    473 meta.update({"count": wd.shape[0]})
    475 # save the tiles with new metadata
--> 476 with rio.open(tile_path, "w", **meta) as outds:
    477     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, -32768.0, is beyond the valid range of its data type, uint8.
@iamtekson iamtekson added the bug Something isn't working label Dec 21, 2023
@iamtekson iamtekson self-assigned this Dec 21, 2023
iamtekson added a commit that referenced this issue Dec 21, 2023
close #68 save_tile issue on nodata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant