hypertidy / ncmeta

Tidy NetCDF metadata
https://hypertidy.github.io/ncmeta/
11 stars 5 forks source link

Interest in NetCDF projection handling? #14

Closed dblodgett-usgs closed 5 years ago

dblodgett-usgs commented 5 years ago

If you'd like the gridmapping and projection code from here: https://github.com/USGS-R/ncdfgeom/tree/master/R, I'd be more than happy to move it to ncmeta and update to match the data constructs used here. It is by no means perfect, but I've gotten a lot of mileage out of it and it is a good starting point for general parsing and conversion of the CF grid_mapping construct.

mdsumner commented 5 years ago

Sounds great! I looked at the geometry storage a while back, but a deeper look at ncdfgeom is on my list for early 2019.

mdsumner commented 5 years ago

Oops, I didn't realize you imported rgdal and used sf for examples - I'm going to remove those - I see they aren't embedded too deeply, so I don't think it's a great loss. I can't have GDAL as a dependency for this (sorry I didn't make that clear, or notice how you did the work).

If there was a low-level facility in R to validate PROJ strings I'd include it, but I can't have this relying on those mega packages - that's one of the tenets of hypertidy, to have re-useable modules for building packages.

I've parked your branch with rgdal and sf in https://github.com/hypertidy/ncmeta/tree/rgdal-sf

dblodgett-usgs commented 5 years ago

ahh -- I was wondering about that. I think we could get away without the rgdal and sf stuff for 90% of what's needed.

dblodgett-usgs commented 5 years ago

And now that I look at what you did... 👍 I think this is totally fine. Would be nice to have validation but totally not needed for now.

mdsumner commented 5 years ago

Well I worried about that and lack of epsg conversion, but I realized later that sf can do its own validation. Many projects won't need this logic anyway. It galvanized my position 👍