<html>
<head>
</head>
<body style="font-style: normal; font-size: 10pt; font-family: Dialog; font-weight: normal; margin-top: 4px; margin-bottom: 1px; margin-right: 4px; font-variant: normal; margin-left: 4px; line-height: normal">
<p style="margin-bottom: 0; margin-top: 0">
<font face="Dialog" size="2">Hi All.</font> </p>
<br>
<p style="margin-bottom: 0; margin-top: 0">
<font face="Dialog" size="2">Thanks for the help got it working...</font> </p>
<br>
<p style="margin-bottom: 0; margin-top: 0">
<font face="Dialog" size="2">This seems to work, Note used setDestinationSrs not setDestinationCrs</font> </p>
<br>
<p style="margin-bottom: 0; margin-top: 0">
<font face="Dialog" size="2">myrender = self.canvas.mapRenderer()</font> </p>
<p style="margin-bottom: 0; margin-top: 0">
<font face="Dialog" size="2">myrender.setProjectionsEnabled(True) </font> </p>
<p style="margin-bottom: 0; margin-top: 0">
<font face="Dialog" size="2">myrender.setDestinationSrs(crsDest)</font> </p>
<br> <br>
<p style="margin-bottom: 0; margin-top: 0">
<font face="Dialog" size="2">Terence</font> </p>
<p style="margin-bottom: 0; margin-top: 0">
<br>
>>> </p>
<table style="font-size: 1em; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 15px" border="0" bgcolor="#f3f3f3">
<tr>
<td>
<div style="border-left: solid 1px #050505; padding-left: 7px">
<table style="font-size: 10pt; font-style: normal; font-family: Dialog; font-weight: normal; font-variant: normal; line-height: normal" bgcolor="#f3f3f3">
<tr valign="top">
<td>
<p style="margin-bottom: 0; margin-top: 0">
<b>From: </b> </p>
</td>
<td>
<p style="margin-bottom: 0; margin-top: 0">
Tim Sutton <lists@linfiniti.com> </p>
</td>
</tr>
<tr valign="top">
<td>
<p style="margin-bottom: 0; margin-top: 0">
<b>To:</b> </p>
</td>
<td>
<p style="margin-bottom: 0; margin-top: 0">
Terence Van Zyl <tvzyl@csir.co.za> </p>
</td>
</tr>
<tr valign="top">
<td>
<p style="margin-bottom: 0; margin-top: 0">
<b>CC:</b> </p>
</td>
<td>
<p style="margin-bottom: 0; margin-top: 0">
<qgis-developer@lists.osgeo.org> </p>
</td>
</tr>
<tr valign="top">
<td>
<p style="margin-bottom: 0; margin-top: 0">
<b>Date: </b> </p>
</td>
<td>
<p style="margin-bottom: 0; margin-top: 0">
3/29/2011 09:27 AM </p>
</td>
</tr>
<tr valign="top">
<td>
<p style="margin-bottom: 0; margin-top: 0">
<b>Subject: </b> </p>
</td>
<td>
<p style="margin-bottom: 0; margin-top: 0">
Re: [Qgis-developer] Getting auto re-projection on Standalone QgsMapCanvas </p>
</td>
</tr>
</table>
<p style="margin-bottom: 0; margin-top: 0">
Hi again<br><br><br><br>On Tue, Mar 29, 2011 at 9:23 AM, Tim Sutton <lists@linfiniti.com> wrote:<br>> Howzit Terence<br>><br>> The c++ version of what you are trying to do is something like (you<br>> need to have already teh myCRSID variable defined):<br>><br>> QgsMapRenderer* myRenderer = mMapCanvas->mapRenderer();<br>> QgsCoordinateReferenceSystem srs( myCRSID,<br>> QgsCoordinateReferenceSystem::InternalCrsId );<br>> myRenderer->setDestinationCrs( srs );\<br><br>You probably need trunk / nightly builds to use this the above call<br>was missing from the python interface and Martin has just added it.<br><br>Regards<br><br>Tim<br><br><br>> myRenderer->setMapUnits( QGis::Meters );<br>> myRenderer->setProjectionsEnabled( true );<br>><br>><br>> I'm not a python guru but you can probably replace those :: and -> 's<br>> with '.' and it should mostly work.<br>><br>> Regards<br>><br>> Tim<br>><br>><br>> On Mon, Mar 28, 2011 at 4:04 PM, Terence Van Zyl <tvzyl@csir.co.za> wrote:<br>>> Hi All, Some help please..<br>>><br>>> From Python I have created a standalone QgsMapCanvas to which I have added a<br>>> number of layers, one raster and then some vector. Is there a way to get the<br>>> vector layers to auto reproject? If Not then how would we do this manually.<br>>><br>>> Thanks<br>>><br>>> Terence<br>>><br>>> --<br>>> This message is subject to the CSIR's copyright terms and conditions, e-mail<br>>> legal notice, and implemented Open Document Format (ODF) standard.<br>>> The full disclaimer details can be found at<br>>> <a href="http://www.csir.co.za/disclaimer.html.">http://www.csir.co.za/disclaimer.html.</a><br>>><br>>> This message has been scanned for viruses and dangerous content by<br>>> MailScanner,<br>>> and is believed to be clean. MailScanner thanks Transtec Computers for their<br>>> support.<br>>><br>>> _______________________________________________<br>>> Qgis-developer mailing list<br>>> Qgis-developer@lists.osgeo.org<br>>> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>>><br>>><br>><br>><br>><br>> --<br>> Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)<br>> ==============================================<br>> Please do not email me off-list with technical<br>> support questions. Using the lists will gain<br>> more exposure for your issues and the knowledge<br>> surrounding your issue will be shared with all.<br>><br>> Visit <a href="http://linfiniti.com">http://linfiniti.com</a> to find out about:<br>>  * QGIS programming and support services<br>>  * Mapserver and PostGIS based hosting plans<br>>  * FOSS Consulting Services<br>> Skype: timlinux<br>> Irc: timlinux on #qgis at freenode.net<br>> ==============================================<br>><br><br><br><br>--<br>Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)<br>==============================================<br>Please do not email me off-list with technical<br>support questions. Using the lists will gain<br>more exposure for your issues and the knowledge<br>surrounding your issue will be shared with all.<br><br>Visit <a href="http://linfiniti.com">http://linfiniti.com</a> to find out about:<br>* QGIS programming and support services<br>* Mapserver and PostGIS based hosting plans<br>* FOSS Consulting Services<br>Skype: timlinux<br>Irc: timlinux on #qgis at freenode.net<br>==============================================<br>
</p>
</div>
</td>
</tr>
</table>
<font face="Verdana,Arial,Helvetica,Trebuchet MS" size="1">
<br />--
<br />This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
<br />The full disclaimer details can be found at <a href="http://www.csir.co.za/disclaimer.html">http://www.csir.co.za/disclaimer.html</a>.
<p>
<br />This message has been scanned for viruses and dangerous content by <a href="http://www.mailscanner.info/"><b>MailScanner</b></a>,
<br />and is believed to be clean. MailScanner thanks <a href="http://www.transtec.co.uk/">Transtec Computers</a> for their support.
</font>
</body>
</html>