[Qgis-developer] Error for use Coordinate Transform

Luiz Motta motta.luiz at gmail.com
Sun Jan 16 21:36:32 EST 2011

Hi Devs,

I am making the plugin, where i use this method
"core.QgsCoordinateTransform.transform", the QGis showed dialog error.

I tested by Python console and the same error showed.

The script to run on python console:

from qgis import core
mapCanvas = qgis.utils.iface.mapCanvas()
srsCanvas = mapCanvas.mapRenderer().destinationSrs()
srsGoogle = core.QgsCoordinateReferenceSystem(900913,
pntCenter = mapCanvas.extent().center()
print pntCenter
coodTrans = core.QgsCoordinateTransform(srsCanvas, srsGoogle)
pntCenter = coodTrans.transform(pntCenter,
core.QgsCoordinateTransform.ForwardTransform) # Error showed here!
print pntCenter

Message error:

Title dialog : Exception
Text message:
forward transform(-0.832741, -0.274682)
failed with error: No such file or directory

My enviroment:
Windows XP
Package from OSGEO install.
QGIS trunck r15051

When i continue running the plugin, the next time call this methods the
error does not appear.

I need initialize one library before call the transform's method  ?

Luiz Motta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20110117/6351da1b/attachment.html

More information about the Qgis-developer mailing list