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
Watershed delineation: handling the case where flow_dir doesn't have an SRS. #338
Watershed delineation: handling the case where flow_dir doesn't have an SRS. #338
Conversation
Also noting this change in HISTORY and testing. RE:natcap#254
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@phargogh this looks good, but I'm not sure I understand when it would be OK to have a missing SRS? How do we know that the flow direction raster intersects with the other inputs?
Well, we don't know for sure! But if the units of the geotransform and geometries are all the same, it may be reasonable to assume that the user knows what they are doing and continue running. So we would be assuming that the inputs are in some projected coordinate system and valid for delineating watersheds. I don't think that's a reasonable assumption to make in InVEST, specifically, but I think it could be OK for a geoprocessing routine like this. What do you think? |
I wonder if it makes sense to have a larger conversation about this and decide when/if this makes sense in general, so we can be consistent within pygeoprocessing? For instance, maybe it's also ok for the outflow vector to have no SRS? But if both inputs have no SRS, is that a problem? |
The consistency question is a good one, and probably worth a discussion! I'll add it to the agenda for an upcoming software team call. In the shorter term, it turns out that we have a valid use case for where there might not be a defined spatial reference: in the various supported raster formats that don't support georeferencing. Taking this CEOS example file from the GDAL tests, the SRS's WKT is falsey: >>> from osgeo import gdal
>>> ds = gdal.Open('/Users/jdouglass/Downloads/IMAGERY-75K.L-3')
>>> ds.GetProjection()
'' |
…b.com:phargogh/pygeoprocessing into bugfix/254-watershed-delineation-requires-srs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding that note to the docstring! It just looks like some extra carraige returns got in there, otherwise good!
Huh, I'm so used to my editor chomping them that I missed them in the diff! Thanks @emlys I think they should be clear now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @phargogh but I'm seeing one more ^M
on line 631, those line ending characters are sneaky!
Also noting this change in HISTORY and testing.
Fixes #254