[Qgis-developer] Getting auto re-projection on Standalone QgsMapCanvas

Tim Sutton lists at linfiniti.com
Wed Mar 30 04:26:19 EDT 2011


Hi

On Tue, Mar 29, 2011 at 1:46 PM, Terence Van Zyl <tvzyl at csir.co.za> wrote:

>  Hi All.
>
>  Thanks for the help got it working...
>
>  This seems to work, Note used setDestinationSrs not setDestinationCrs
>
>
Ok thats actually a bug because *Srs methods are to be deprecated in favour
of *Crs. I'll update the bindings.

Regards

Tim


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



-- 
Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
==============================================
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.

Visit http://linfiniti.com to find out about:
 * QGIS programming and support services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux
Irc: timlinux on #qgis at freenode.net
==============================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20110330/ac0b4e7d/attachment.html


More information about the Qgis-developer mailing list