[QGIS-trac] Re: [Quantum GIS] #1339: Can't set projection to WGS84 UTM Zone 15N

Quantum GIS qgis at qgis.org
Wed Oct 29 07:01:58 EDT 2008


#1339: Can't set projection to WGS84 UTM Zone 15N
-----------------------------------------------------+----------------------
        Reporter:  vedgewater                        |         Owner:  nobody       
            Type:  bug                               |        Status:  new          
        Priority:  major: does not work as expected  |     Milestone:  Version 1.0.0
       Component:  Projection Support                |       Version:  0.11.0       
      Resolution:                                    |      Keywords:  UTM SRSID    
Platform_version:                                    |      Platform:  Gentoo       
        Must_fix:  No                                |   Status_info:  0            
-----------------------------------------------------+----------------------
Comment (by fpacheco):

 Vince,
 If you just want to get the layer by name and then take for example the
 srsid believe that this code would be sufficient:
 {{{
 def getVectorLayerByName(myName):
   mc = iface.getMapCanvas()
   nLayers = mc.layerCount()
   for l in range(nLayers):
     layer = mc.getZpos(l)
     if str(layer.name()) == str(myName):
       return layer


 regionLayer = getVectorLayerByName("boundaryPolygons_004")

 regionLayer.srs().srsid()
 }}}

 Please, try it and tell me the results. Regards, Fernando.

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1339#comment:4>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list