Constantin
Constantin

Reputation: 11

Python: get latitude/ longitude of a pixel location in an image, if corner coordinates are known

I have a satellite SAR image (Iceye GRD)(s. img below) and in its metadata the latitude/ longitude for each of the four image corners are given, i.e.:

image pixel -> georef. location

[1, 1] -> [1.6033675891108876, 104.05738201292307]

[16892, 1] -> [1.5291001811499518, 104.42831446776263]

[1, 26855] -> [1.0079111030191064, 103.93758132038617]

[16892, 26855] -> [0.9334645684110325, 104.30991666976476]

example SAR image

I also know it's using WGS84 as a georeference system, but there's no specific src given.

What's the best way to write a funtion, which returns the real world coordinate for a given pixel coordinate, so for example the latitude/ longitude for (10000, 200000)? Is there a lightweight python module capable of doing this?

I tried opening the transform using rasterio, but its .transform simply returns a matrix filled with ones, so calling it results in pixel location = georef. location.

Upvotes: 1

Views: 253

Answers (0)

Related Questions