Martin,<div><br></div><div>Thank´s for your message.</div><div><br></div><div>I read the source:</div><div><a href="http://doc.qgis.org/head/qgscoordinatetransform_8cpp-source.html#l00558">http://doc.qgis.org/head/qgscoordinatetransform_8cpp-source.html#l00558</a></div>
<div><br></div><div><div><div><div>const char *finder( const char *name )</div><div>{</div><div> QString proj;</div><div>#ifdef WIN32</div><div> proj = QApplication::applicationDirPath()</div><div> + "/share/proj/" + QString( name );</div>
<div>#endif</div><div> return proj.toUtf8();</div><div>}</div></div></div></div><div><br></div><div>I tested the value of proj in console:</div><div><br></div><div><div>from PyQt4 import QtCore, QtGui</div><div>print QtGui.QApplication.applicationDirPath()</div>
</div><div><br></div><div><div>The out in my enviroment is</div><div>" C:\OSGeo4W\apps\qgis-dev\bin", </div><div>for my friend is </div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; ">"C:/PROGRA~1/QUANTU~2/apps/qgis/bin"</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><font class="Apple-style-span" face="arial, sans-serif">For me, i created and copied directory, from "C:\OSGeo4W\share\proj" to </font>" C:\OSGeo4W\apps\qgis-dev\bin\<span class="Apple-style-span" style="font-family: arial, sans-serif; ">share\proj</span>"</div>
<div><br></div><div>With this the problem in windows is resolved.</div><div><br></div><div>Need change the source of path proj in method "const char *finder( const char *name )" or make the review where have the first setting the directory for Proj,</div>
<div> because, when i still use the plugin, the directory was setting correct</div><div><br></div><div>Regards,</div><div>Luiz</div><div><br></div><div><br></div><div><div class="gmail_quote">2011/1/19 Martin Dobias <span dir="ltr"><<a href="http://wonder.sk">wonder.sk</a>@<a href="http://gmail.com">gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Mon, Jan 17, 2011 at 3:36 AM, Luiz Motta <<a href="mailto:motta.luiz@gmail.com">motta.luiz@gmail.com</a>> wrote:<br>
> Hi Devs,<br>
> I am making the plugin, where i use this method<br>
> "core.QgsCoordinateTransform.transform", the QGis showed dialog error.<br>
> I tested by Python console and the same error showed.<br>
> The script to run on python console:<br>
> from qgis import core<br>
> mapCanvas = qgis.utils.iface.mapCanvas()<br>
> srsCanvas = mapCanvas.mapRenderer().destinationSrs()<br>
> srsGoogle = core.QgsCoordinateReferenceSystem(900913,<br>
> core.QgsCoordinateReferenceSystem.EpsgCrsId)<br>
> pntCenter = mapCanvas.extent().center()<br>
> print pntCenter<br>
> coodTrans = core.QgsCoordinateTransform(srsCanvas, srsGoogle)<br>
> pntCenter = coodTrans.transform(pntCenter,<br>
> core.QgsCoordinateTransform.ForwardTransform) # Error showed here!<br>
> print pntCenter<br>
><br>
> Message error:<br>
> Title dialog : Exception<br>
> Text message:<br>
> forward transform(-0.832741, -0.274682)<br>
> failed with error: No such file or directory<br>
<br>
</div>Luiz,<br>
<br>
what is the map canvas CRS you have been using? The error message you<br>
got was an unhandled projection exception (impossible to catch in<br>
python). The error suggests that some file that proj4 needs is<br>
missing. However you shouldn't need to init anything. On windows we<br>
explicitly set where the proj4 files should be (see<br>
QgsCoordinateTransform::setFinder).<br>
<font color="#888888"><br>
Martin<br>
</font></blockquote></div><br></div></div>