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

CLI flag for nodata #138

Closed
NewForestsUS opened this issue Dec 13, 2016 · 3 comments
Closed

CLI flag for nodata #138

NewForestsUS opened this issue Dec 13, 2016 · 3 comments

Comments

@NewForestsUS
Copy link

I'm working on a HFA raster (Archive.zip) wherein no data is referenced as nan. When I run 'raterstats' based on this geojson, the output says 0 for the count of nodata cells despite the fact that there are many.

foo.txt

Thanks in advance for any guidance!

@perrygeo
Copy link
Owner

perrygeo commented Dec 13, 2016

"nodata" refers to cells which are equal to a specified value and explicitly represent the absence of data. They are mostly useful for integral data types.

"NaN" are not necessarily "nodata" (they could be cells where the result of some calculation yielded an incalculable value but it is still a valid data nonetheless) thus have slightly different semantics.

It's possible to have both nodata and NaN values, as might be the case with your merged.img data

screen shot 2016-12-13 at 4 50 37 pm

Currently nans are just ignored in the calcs but are not explicitly counted. See #105 for some ongoing discussion - we need to separate nodata from nan and report them differently.

@NewForestsUS
Copy link
Author

Thanks @perrygeo ! since I'm building the raster, I can attribute those cells as I please. Whats would be the best strategy/is it possible to give them a value that the current nodata result would track?

@sgoodm
Copy link
Contributor

sgoodm commented Mar 24, 2017

guessing this was solved but just in case

@NewForestsUS you can assign those cells any non-nan value (use your raster's nodata value if it already has one) and just pass it to rasterstats using the nodata option

@perrygeo, can close this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants