pygeoapi icon indicating copy to clipboard operation
pygeoapi copied to clipboard

Add NetCDF and COG output types for EDR.

Open dblodgett-usgs opened this issue 4 years ago • 2 comments

This will require some planning and implementation.

The ability to return NetCDF and GeoTIFF files would be a valuable addition to the EDR provider. Shane Mill (NOAA) has a prototype.

Closure Criteria: When the EDR Xarray provider can output geotiff and netcdf outputs and an initial pattern for implementing these outputs in other/new EDR providers is established.

dblodgett-usgs avatar Nov 04 '21 16:11 dblodgett-usgs

NetCDF is relatively straightforward once you have the data in an xarray dataset object. You can output to netcdf using the to_netcdf function:

http://xarray.pydata.org/en/stable/generated/xarray.Dataset.to_netcdf.html

Specifically with GRIB data, your netcdf file should be CF compliant if you use the cfgrib engine to open the GRIB file.

For Cloud Optimized GeoTiff, I used the datacube module and the to_cog function (to translate xarray object to COG): https://datacube-core.readthedocs.io/en/stable/dev/api/generate/datacube.utils.cog.to_cog.html

The interesting thing here is when you have multidimensional data, COG may not be the most optimal format because I believe to_cog only supports 2D or 3D writing of data. For x,y,z,t you would have to create multiple COG files.

I am wondering if rasterio/rio can convert xarray objects to COG as well? Might be worth looking into

ShaneMill1 avatar Nov 16 '21 23:11 ShaneMill1

This Issue has been inactive for 90 days. As per RFC4, in order to manage maintenance burden, it will be automatically closed in 7 days.

github-actions[bot] avatar Mar 24 '24 03:03 github-actions[bot]

As per RFC4, this Issue has been closed due to there being no activity for more than 90 days.

github-actions[bot] avatar Apr 07 '24 03:04 github-actions[bot]