NetCDF to CoG workflow #257
Unanswered
CapeHobbit
asked this question in
Q&A
Replies: 1 comment 4 replies
-
You have multiple options here. You could use GDAL python bindings to do everything or rasterio+rio-cogeo You could in theory do the reprojection/conversion to COG in one GO (without needed to write intermediate files) but it will depends on how your original NetCDF is structured. import rasterio
from rasterio.vrt import WarpedVRT
from rio_cogeo.cogeo import cog_translate
from rio_cogeo.profiles import cog_profiles
out_profile = cog_profiles.get("deflate")
with rasterio.open("my.nc") as src:
with WarpedVRT(src, crs="epsg:3857") as vrt:
cog_translate(vrt, "out.tif", out_profile, allow_intermediate_compression=True) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi cogeotiff team,
I apologise in advance for this very general query. I am looking for pythonic ways to translate level-2 satellite data from a series of 2D irregularly gridded netCDF files to CoG. I very much see rio-cogeo as the last point in this chain, but I am wondering if you have recommendations about how to reach to a good "ingestion point" for it. So far, reprojecting from the original grid with rasterio/rio-xarray is causing me huge headaches (and yet they seem to recommended over osgeo gdal), and so I wondered if you have encountered, or can recommend, a similar workflow?
Things I want to avoid;
I realise that my problem is not the one you are trying to solve, but any advice would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions