Created
June 23, 2022 15:51
-
-
Save evu/1a2d7dd08af6617d5e732e6c1348a920 to your computer and use it in GitHub Desktop.
Get image x, y coordinates of point on geotiff using lat, lon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rasterio as rio | |
ds = rio.open(img_file) | |
for lon, lat in points: | |
y, x = ds.index(lon, lat) | |
print(x, y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment