cf-json / cf-json.github.io

Apache License 2.0
0 stars 2 forks source link

Using JSON `null` for missing data #13

Open aportagain opened 5 years ago

aportagain commented 5 years ago

Split out for further discussion from https://github.com/cf-json/cf-json.github.io/issues/10 , where @aportagain originally commented:

The last separate issue that I can think of at the moment concerns JSON null. We've found this quite handy, JSON parsers and generators in multiple languages deal well with it, and I think it's also very much in the as-simple-as-possible spirit. This is more like an item for a wish list for a new / revised format level of nco-json... should I still split it out as a separate issue in this repo here at least for now? Or would it be better to wait until @czender has a draft "format spec" document ready so that we could create issues and potentially pull requests in direct relation to that?

and @ChrisBarker-NOAA asked:

What would you use it for? Is null supported in netCDF? If not, do you see it as an alternative to special “missing values” or Fill_Value?

aportagain commented 5 years ago

Yup, "alternative" sounds right: since JSON conveniently does provide null as a primitive data type, we use it as a simpler alternative to the values-defined-by-attributes way of identifying missing data (_FillValue, missing_value, valid_range or valid_min / valid_max; and I guess in some way also the netCDF default fill values for each data-type?).