Skip to content

Instantly share code, notes, and snippets.

@evu
Created June 23, 2022 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evu/1a2d7dd08af6617d5e732e6c1348a920 to your computer and use it in GitHub Desktop.
Save evu/1a2d7dd08af6617d5e732e6c1348a920 to your computer and use it in GitHub Desktop.
Get image x, y coordinates of point on geotiff using lat, lon
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