Many APIs such as overpass turbo require bounding box notation like (x_max, y_max, y_min, x_min) in EPSG:4326. However the method QgsVectorLayer.extent() returns values in the source's CRS. A possible solution of course is to reproject the QgsRectangle as described here long time ago. But I wonder:

Is there a way to easily return these coordinates in EPSG:4326 without having to reproject all the data i want to derive extents from?

I mean Qgis nativliy derives these coordinates when using the 'Identify Features' tool and also by glancing at the sourcecode of the the plugin 'QickOSM' it seems capable of doing so.

  • 1
    What's wrong with the linked post? I would describe that as relatively easy. It's not projecting all your data, just the bounding box and I would say from the docs qgis.org/pyqgis/3.2/core/Coordinate/… it accounts for the bounding box becoming a trapezoid when projected by taking the bounding box of the trapezoid - not 100% accurate but usually good enough. – Michael Stimson Nov 12 '18 at 1:35
  • There's nothing wrong with it. It was in fact applied eventually. – maxwhere Nov 22 '18 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.