Hi,
I would like to make an animation of Sentinel 3 LST products placed on a map over time, following their acquisition timestamp.
I’m using python, I already downloaded the products with sentinelsat and the next step is using snappy to convert the LST band to a png, reprojected to a web mercator projection.
Since png can’t store information about coordinates I was thinking about saving each product’s bounding box in a database or static file. this is the code to get the coordinates, which works fine:
directory = r'./data'
for entry in os.scandir(directory):
if entry.is_dir():
in_file = entry.path + "/" + "/xfdumanifest.xml"
product = ProductIO.readProduct(in_file)
w = product.getSceneRasterWidth()
h = product.getSceneRasterHeight()
geocode = product.getSceneGeoCoding()
p1 = geocode.getGeoPos(PixelPos(0,0),GeoPos())
p2 = geocode.getGeoPos(PixelPos(w,0),GeoPos())
p3 = geocode.getGeoPos(PixelPos(0,h),GeoPos())
p4 = geocode.getGeoPos(PixelPos(w,h),GeoPos())
These coordinates should then be used to get the square bounding box in pixels relative to the map. I have two issues:
-
I’m having a hard time finding an example of reprojection with a png output, does anyone have an example to show me? I tried it on SNAP, but choosing PNG as output and “Popular visualization pseudo mercator” as projection, I get a blank image. Doing so on a GeoTiff, I get a 1 Gb file
-
I should also resample each product to be in scale with the global map. Let’s say I want a 1920px wide map, how should I resample a product accordingly?
Thanks,
Daniele