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

Urban Nature Access: handle undefined nodata in raster inputs #1539

Closed
davemfish opened this issue Mar 13, 2024 · 0 comments · Fixed by #1540
Closed

Urban Nature Access: handle undefined nodata in raster inputs #1539

davemfish opened this issue Mar 13, 2024 · 0 comments · Fixed by #1540
Labels
bug Something isn't working
Milestone

Comments

@davemfish
Copy link
Contributor

Presently, if the LULC raster does not have a nodata value set, we see an error like this:

Traceback (most recent call last):
  File "natcap\invest\utils.py", line 164, in prepare_workspace
  File "invest\cli.py", line 470, in main
  File "natcap\invest\urban_nature_access.py", line 1026, in execute
  File "taskgraph\Task.py", line 674, in add_task
  File "taskgraph\Task.py", line 1093, in _call
  File "natcap\invest\urban_nature_access.py", line 1862, in _reclassify_urban_nature_area
  File "natcap\invest\utils.py", line 731, in reclassify_raster
  File "pygeoprocessing\geoprocessing.py", line 2373, in reclassify_raster
TypeError: '>' not supported between instances of 'int' and 'NoneType'

See line 1860:
urban_nature_area_map[lulc_raster_info['nodata'][0]] = FLOAT32_NODATA

@davemfish davemfish added the bug Something isn't working label Mar 13, 2024
@davemfish davemfish added this to the 3.14.2 milestone Mar 13, 2024
davemfish added a commit to davemfish/invest that referenced this issue Mar 13, 2024
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

Successfully merging a pull request may close this issue.

1 participant