Re: Convert BoundingBox data into lat/lon

Guillaume Lostis <g.lostis@...>


The rasterio.warp.transform_bounds function should do what you want:

Pass it the CRS of your dataset as src_crs, CRS({'init': 'EPSG:4326'}) as dst_crs, and your bounds, and you will get your bounds in lon/lat as output.


Guillaume Lostis 

On Tue, 21 Jul 2020, 09:36 toku2288 via, <> wrote:
Hi, I need to convert the bounding box data of a TIF file to lat/lon co-ordinates so I can request data from another API

GridTIF.bounds returns a BoundingBox object like the following:
BoundingBox(left=-2638055.0614613006, bottom=340165.4847189281, right=2410944.9385386994, top=5922165.484718928)
Is there some way to convert this to lat/lon of the two corners in it's current CRS?

Join to automatically receive all group messages.