R: Re: [Qgis-developer] Trasform QgsVectorLayer proj4 to another

francescoboccacci at libero.it francescoboccacci at libero.it
Wed Dec 14 07:55:05 EST 2011


Hi,
i tried it but it works only with point tranformation. I would llike to 
tranform the entire vector layer.
Do you have any suggestions?

Thanks

Francesco

>----Messaggio originale----
>Da: rdmailings at duif.net
>Data: 14/12/2011 13.06
>A: "francescoboccacci at libero.it"<francescoboccacci at libero.it>
>Cc: <qgis-developer at lists.osgeo.org>
>Ogg: Re: [Qgis-developer] Trasform QgsVectorLayer proj4 to another
>
>On 2011-12-14 12:59, francescoboccacci at libero.it wrote:
>> Hi to all,
>> i have a question for you. I have 2 vector layer that have two different 
>> spatial references. I'd like to tranform(convert) one of these in the same 
>> coordinate system.
>> Like that:
>> 
>>  crsStart = QgsCoordinateReferenceSystem()
>>  crsStart.createFromProj4(layerA.crs().toProj4())
>>  crsDest = QgsCoordinateReferenceSystem()  
>>  crsDest.createFromProj4(layerB.crs().toProj4())
>>    
>>   if crsStart != crsDest:
>>   
>>                     layerA = QgsCoordinateTransform(crsStart,crsDest).
>> transformLayerAtoLayerB
>
>Hi F,
>
>Have a look here:
>
>http://www.qgis.org/pyqgis-cookbook/index.html
>
>specially here:
>
>http://www.qgis.org/pyqgis-cookbook/crs.html#coordinate-reference-systems
>
>Hope this helps...
>
>Regards,
>
>Richard
>




More information about the Qgis-developer mailing list