projectionnetcdf4rasteriopyproj

Reproject geo data and save to NetCDF4


I need to reproject geodetic point data from Gauß-Krüger coord system with discrete data values into a UTM coord system and finally write that data into a netCDF raster file. I was recommended to use python to do this. I tried with PyProj4 which transforms the coordinates but returns (n*m) x (n*m) coordinates from n x m input coordinates which would require an extra resampling as with this much data cannot be continued.

Rasterio provides reprojection and resampling algorithms but seems to be unable to write the netCDF4 format (according to https://rasterio.readthedocs.io/en/latest/api/rasterio.drivers.html#module-rasterio.drivers)

I'm unsure if I'm on the right track and what to do now:

I guess the second way is the way to go? Or is there other and easier ways to achieve this?


Solution

  • I think that you are looking for rioxarray. Here is an example reprojecting a netCDF file: https://corteva.github.io/rioxarray/stable/examples/reproject.html