[Qgis-developer] Getting center of layer in lat/long

Mark Coletti mcoletti at gmail.com
Mon Sep 8 08:25:10 PDT 2014


On Fri, Jun 13, 2014 at 7:24 PM, Nathan Woodrow <madmanwoo at gmail.com> wrote:

> Hey Mark
>
> I think you are over thinking it ;)
>
> Iface.mapCanvas().extent() will give you the event of the view.
> Extent.center() for the middle.
>
> You can transform this using the coordinate transformation classes.
>
>
> That'd be nice ... if I could get a hold of the CRS that the map canvas is
using.  So, I can get the center point, but I'd like to transform it to
geographic coordinates, but do not know the CRS that the returned extent is
using.  I've grepped through the API and do not see how to get this
information.

(And, it would seem there is a delta between the documented API and the
actual API available.  Will the documented API be updated soon?)

Cheers,

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140908/54a4a911/attachment-0001.html>


More information about the Qgis-developer mailing list