I am opening a raster with rasterio.open() after which I extract its bbox:
import rasterio
img = rasterio.open('myraster.tif')
bbox = img.bounds
print(bbox)
BoundingBox(left=450498.0, bottom=3509708.5, right=452789.0, top=3510922.5)
I want to plot it know on a folium map, for which I need the coordinates in lat/lon and not in UTM (which they are by default).
Is there a way to reproject the bbox directly within rasterio. My approach so far would be to convert that bbox to a shapely polygon, then reproject and plot. Would there be a more direct solution to avoid creating the shapely polygon?
The simplest way to transform coordinates in Python is pyproj:https://gis.stackexchange.com/a/78944/35561 – Comrade Che Feb 03 '23 at 09:20