How can i get the geographical coordinates from x,y position in a Sentinel-1 Synthetic Aperture Radar (SAR) satellite image?
For example, I can access a downloaded image info sg
as
from snappy import ProductIO
from snappy import PixelPos
path='path_name'
product = ProductIO.readProduct(path)
sg = product.getSceneGeoCoding()
But how can I get latitude and longitude for a desired point (x, y) in sg
using ESA's snap engine within Python?
Using the custom function below, we can easily convert any point inside our image
sg
to its coordinates (latitude,longitude):UPD: Because of various snap version updates, function above may not be working properly. Function below should work most of the times.
E.g. for the given
sg
product, we can get coordinates of pixel (x=12000, y=2000) as