Skip to content
Permalink
Browse files

use crs() instead of deprecated srs()

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15322 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
alexbruy
alexbruy committed Mar 3, 2011
1 parent 97d366d commit 62e7df74dbc02c68722e50b0f6afad13665be67a
@@ -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)
@@ -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 ) ):
@@ -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
@@ -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 ) )
@@ -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()
@@ -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:
@@ -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()

0 comments on commit 62e7df7

Please sign in to comment.
You can’t perform that action at this time.