[QGIS Commit] r15322 - trunk/qgis/python/plugins/fTools/tools

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Mar 3 12:27:25 EST 2011


Author: alexbruy
Date: 2011-03-03 09:27:25 -0800 (Thu, 03 Mar 2011)
New Revision: 15322

Modified:
   trunk/qgis/python/plugins/fTools/tools/doDefineProj.py
   trunk/qgis/python/plugins/fTools/tools/doGeometry.py
   trunk/qgis/python/plugins/fTools/tools/doMergeShapes.py
Log:
use crs() instead of deprecated srs()

Modified: trunk/qgis/python/plugins/fTools/tools/doDefineProj.py
===================================================================
--- trunk/qgis/python/plugins/fTools/tools/doDefineProj.py	2011-03-03 15:55:16 UTC (rev 15321)
+++ trunk/qgis/python/plugins/fTools/tools/doDefineProj.py	2011-03-03 17:27:25 UTC (rev 15322)
@@ -65,8 +65,8 @@
                     srsDefine.createFromProj4(outProj)
                 else:
                     destLayer = ftools_utils.getVectorLayerByName(self.cmbLayer.currentText())
-                    srsDefine = destLayer.srs()
-                if srsDefine == vLayer.srs():
+                    srsDefine = destLayer.crs()
+                if srsDefine == vLayer.crs():
                     responce = QMessageBox.question(self, self.tr("Define current projection"),
                     self.tr("Identical output spatial reference system chosen\n\nAre you sure you want to proceed?"),
                     QMessageBox.Yes, QMessageBox.No, QMessageBox.NoButton)

Modified: trunk/qgis/python/plugins/fTools/tools/doGeometry.py
===================================================================
--- trunk/qgis/python/plugins/fTools/tools/doGeometry.py	2011-03-03 15:55:16 UTC (rev 15321)
+++ trunk/qgis/python/plugins/fTools/tools/doGeometry.py	2011-03-03 17:27:25 UTC (rev 15322)
@@ -206,8 +206,8 @@
       self.cancel_close.setText( "Close" )
       QObject.disconnect( self.cancel_close, SIGNAL( "clicked()" ), self.cancelThread )
       if success:
-        addToTOC = QMessageBox.question( self, self.tr("Geometry"), 
-          self.tr( "Created output shapefile:\n%1\n%2\n\nWould you like to add the new layer to the TOC?" ).arg( unicode( self.shapefileName ) ).arg( extra ), 
+        addToTOC = QMessageBox.question( self, self.tr("Geometry"),
+          self.tr( "Created output shapefile:\n%1\n%2\n\nWould you like to add the new layer to the TOC?" ).arg( unicode( self.shapefileName ) ).arg( extra ),
           QMessageBox.Yes, QMessageBox.No, QMessageBox.NoButton )
         if addToTOC == QMessageBox.Yes:
           if not ftools_utils.addShapeToCanvas( unicode( self.shapefileName ) ):
@@ -603,7 +603,7 @@
     del writer
     return True
 
-    
+
   def clip_voronoi(self, edges, c, width, height, extent, exX, exY):
     """ Clip voronoi function based on code written for Inkscape
         Copyright (C) 2010 Alvin Penner, penner at vaxxine.com
@@ -696,7 +696,7 @@
       if hasYMin:
         lines.append(QgsPoint(width+extent.xMinimum()+exX, extent.yMinimum()-exY))
     return lines
-    
+
   def layer_extent( self ):
     self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
     self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, 0 ) )
@@ -713,7 +713,7 @@
     9 : QgsField( "WIDTH", QVariant.Double ) }
 
     writer = QgsVectorFileWriter( self.myName, self.myEncoding,
-    fields, QGis.WKBPolygon, self.vlayer.srs() )
+    fields, QGis.WKBPolygon, self.vlayer.crs() )
     rect = self.vlayer.extent()
     minx = rect.xMinimum()
     miny = rect.yMinimum()
@@ -858,13 +858,13 @@
 
   def singleToMultiGeom(self, wkbType):
       try:
-          if wkbType in (QGis.WKBPoint, QGis.WKBMultiPoint, 
+          if wkbType in (QGis.WKBPoint, QGis.WKBMultiPoint,
                          QGis.WKBPoint25D, QGis.WKBMultiPoint25D):
               return QGis.WKBMultiPoint
           elif wkbType in (QGis.WKBLineString, QGis.WKBMultiLineString,
                            QGis.WKBMultiLineString25D, QGis.WKBLineString25D):
               return QGis.WKBMultiLineString
-          elif wkbType in (QGis.WKBPolygon, QGis.WKBMultiPolygon, 
+          elif wkbType in (QGis.WKBPolygon, QGis.WKBMultiPolygon,
                            QGis.WKBMultiPolygon25D, QGis.WKBPolygon25D):
               return QGis.WKBMultiPolygon
           else:

Modified: trunk/qgis/python/plugins/fTools/tools/doMergeShapes.py
===================================================================
--- trunk/qgis/python/plugins/fTools/tools/doMergeShapes.py	2011-03-03 15:55:16 UTC (rev 15321)
+++ trunk/qgis/python/plugins/fTools/tools/doMergeShapes.py	2011-03-03 17:27:25 UTC (rev 15322)
@@ -186,7 +186,7 @@
     # get information about shapefiles
     layerPath = QFileInfo( self.baseDir + "/" + self.shapes[ 0 ] ).absoluteFilePath()
     newLayer = QgsVectorLayer( layerPath, QFileInfo( layerPath ).baseName(), "ogr" )
-    self.crs = newLayer.srs()
+    self.crs = newLayer.crs()
     self.geom = newLayer.wkbType()
     vprovider = newLayer.dataProvider()
     self.fields = vprovider.fields()



More information about the QGIS-commit mailing list