[Qgis-user] Change Projection in Projection Properties from a Python PlugIn

bjsvwpfe Michael.Pfeiffer at bd.so.ch
Thu May 29 03:24:23 PDT 2008


Hi,

thanks for the answers. That was exactly what I'm searching for :jumping:
So its possible for me to set the project settings now.
But theres still a last little problem. I make the settings with the
following code:

    srs = QgsSpatialRefSys()
    srs.createFromEpsg(21781)
    self.canvas = self.iface.getMapCanvas()
    self.canvas.setMapUnits(QGis.METERS)
    self.rect = self.canvas.extent()
    mapRender = self.canvas.mapRender()
    mapRender.setDestinationSrs(srs)
    mapRender.setProjectionsEnabled(1)
    self.canvas.refresh()

But the project settings are not applied to the map. You still have to press
the apply Button in the Project Settings.
How can I solve this last problem so that it is not necessary to press the
apply button.

Thanks in advance.

Michael
-- 
View this message in context: http://www.nabble.com/AW%3A-Change-Projection-in-Projection-Properties-from-a-Python-PlugIn-tp17516111p17532405.html
Sent from the qgis-user mailing list archive at Nabble.com.




More information about the Qgis-user mailing list