Skip to content
Permalink
Browse files

improved handeling of postGIS layers

git-svn-id: http://svn.osgeo.org/qgis/trunk@10095 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer
cfarmer committed Feb 2, 2009
1 parent f6bda8b commit a35d6d700588f6f61f16a3ae4743c9d8a1a724e6
Showing with 7 additions and 5 deletions.
  1. +7 −5 python/plugins/fTools/tools/doGeoprocessing.py
@@ -276,7 +276,6 @@ def buffering( self, useField ):
def convex_hull(self, useField ):
vproviderA = self.vlayerA.dataProvider()
allAttrsA = vproviderA.attributeIndexes()
vproviderA.select( allAttrsA )
fields = vproviderA.fields()
writer = QgsVectorFileWriter( self.myName, self.myEncoding,
fields, QGis.WKBPolygon, vproviderA.crs() )
@@ -291,10 +290,11 @@ def convex_hull(self, useField ):
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0)
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
for i in unique:
vproviderA.rewind()
hull = []
first = True
outID = 0
vproviderA.select( allAttrsA )
vproviderA.rewind()
while vproviderA.nextFeature( inFeat ):
nElement += 1
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
@@ -339,7 +339,6 @@ def convex_hull(self, useField ):
def dissolve( self, useField ):
vproviderA = self.vlayerA.dataProvider()
allAttrsA = vproviderA.attributeIndexes()
vproviderA.select( allAttrsA )
fields = vproviderA.fields()
writer = QgsVectorFileWriter( self.myName, self.myEncoding,
fields, vproviderA.geometryType(), vproviderA.crs() )
@@ -368,17 +367,20 @@ def dissolve( self, useField ):
outFeat.setAttributeMap( attrs )
writer.addFeature( outFeat )
else:
unique = ftools_utils.getUniqueValues( vproviderA, int( self.myParam ) )
unique = vproviderA.uniqueValues( int( self.myParam ) )
nFeat = nFeat * len( unique )
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0)
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
for item in unique:
first = True
vproviderA.select( allAttrsA )
vproviderA.rewind()
while vproviderA.nextFeature( inFeat ):
nElement += 1
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
if inFeat.attributeMap()[ self.myParam ].toString().trimmed() == item.toString().trimmed():
atMap = inFeat.attributeMap()
tempItem = atMap[ self.myParam ]
if tempItem.toString().trimmed() == item.toString().trimmed():
if first:
QgsGeometry( inFeat.geometry() )
tmpInGeom = QgsGeometry( inFeat.geometry() )

0 comments on commit a35d6d7

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