How do I find a location specified in lat/long on a GeoTiff image (epsg:32643) in python?

Viewed 42

My overall task is to find a point of interest (specified in lat, lon) on a large .tif satellite image and crop the .tif image such that the point of interest is in the center of a nxn tile.

I am not too well-versed in geospatial programming so I'm kind of lost but I am currently unable to figure out how to find the point of interest on the .tif file. I tried using dataset.index(lon, lat) from rasterio but the output of that exceeded the width and height of the image (i.e dataset.index(lon, lat) gives something like 1063976, -234685 but the tif file is only 800x800) so I don't know what to make of it.

Any direction you could point me to would be super useful at this point!

Alternately, I'm thinking of constructing a shapefile with the lon, lat and a radius of n, and then clipping the .tif file with this shapefile using gdal, but I don't expect that to be straightforward either. So any thoughts at all would be super useful.

0 Answers
Related