[Qgis-developer] [processing] Get canvas CRS from Processing script

Spencer Gardner spencergardner at gmail.com
Thu Nov 5 04:48:44 PST 2015


I'm creating a Processing plugin for which one of the inputs for one of the
tools is a CRS. I'd like to use the CRS from the map canvas as the default
for this parameter but I can't figure out whether this is possible.

My main problem seems to be that the ParameterCrs object is created when
the plugin is first loaded (when QGIS is initialized), so if I parse the
authid() of the map canvas when the plugin loads, it automatically sets to
4326. I can't figure out whether there's a way to re-initialize this
parameter with a different CRS when I actually click on the tool.

Is this technically impossible within the current framework? How can I
accomplish this?

Thanks,
Spencer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20151105/8906723d/attachment.html>


More information about the Qgis-developer mailing list