I want to write my Sentinel 1 product to Cloud Optimize GeoTiff (COG) using snappy.
Write now I do preprocessing of raw sentinel 1 product write to GeoTiff and then use GDAL to convert it to COG. Is there a direct way to write to COG directly, or do I always have to first write the file to a Geotiff and then do a gdal_translate?
Alternatively, I have a final object from GPF.createProduct, would it be advisable to extract the image array from this object and then use python gdal libraries for COG? Can this be done?
Quoting Cloud Optimized GeoTIFF (cogeo.org):
QGIS 3.2 has stellar COG support,
QGIS can import BEAM DIMAP images as well as NetCDF, both formats with better support for metadata than GeoTIFF currently provides.
This should be possible, but will be inefficient in time and memory resources. QGIS is widely used so if you encounter problems it is likely the best place to look for help.
Thanks for your response, but I am planning to do things completely in a pythonic way.
As I want to batch process S1 Products on a cloud server. I would have used QGIS if I had only 1 image to deal with.
Also ProductIO.writeProduct and jpy.get_type(‘org.esa.snap.core.gpf.common.WriteOp’) are already memory and time consuming processes, so it would be great if you could guide me in the right direction if I can use the alternate approach.
Have you investigated snapista? It uses snappy only to get the parameters of operators, then runs gpt via
subprocess.run(). Then you have the options of using a python library to convert the gpt result to COG or another
There are efforts underway to supplement GeoTIFF and PNG metadata deficits using external files, e.g., GDAL Raster Data Model. In my experience, a big part of the effort to support “clients” using a data repository is answering questions about details that are in the upstream metadata but get lost when “clients” require GeoTIFF or PNG format files.