Skip to content

Commit

Permalink
use crs() instead of deprecated srs()
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15322 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
alexbruy committed Mar 3, 2011
1 parent 97d366d commit 62e7df7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions python/plugins/fTools/tools/doDefineProj.py
Expand Up @@ -65,8 +65,8 @@ def accept(self):
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)
Expand Down
14 changes: 7 additions & 7 deletions python/plugins/fTools/tools/doGeometry.py
Expand Up @@ -206,8 +206,8 @@ def runFinishedFromThread( self, success ):
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 ) ):
Expand Down Expand Up @@ -603,7 +603,7 @@ def voronoi_polygons( self ):
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@vaxxine.com
Expand Down Expand Up @@ -696,7 +696,7 @@ def clip_line(x1, y1, x2, y2, w, h, x, y):
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 ) )
Expand All @@ -713,7 +713,7 @@ def layer_extent( self ):
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()
Expand Down Expand Up @@ -858,13 +858,13 @@ def remove_bad_lines( self, lines ):

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:
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/fTools/tools/doMergeShapes.py
Expand Up @@ -186,7 +186,7 @@ def run( self ):
# 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()
Expand Down

0 comments on commit 62e7df7

Please sign in to comment.