Skip to content
Permalink
Browse files

Merge branch 'master' of github.com:qgis/Quantum-GIS

  • Loading branch information
timlinux committed May 25, 2012
2 parents 88a319a + 40c34d4 commit db164dfbb7dfb909e82ebc63721ba8f842f5572f
@@ -144,7 +144,7 @@ install: build
$(MAKE) -C debian/build install DESTDIR=$(CURDIR)/debian/tmp

# remove unwanted files
rm debian/tmp/usr/share/qgis/doc/api/installdox
! [ -f debian/tmp/usr/share/qgis/doc/api/installdox ] || rm debian/tmp/usr/share/qgis/doc/api/installdox
! [ -f debian/tmp/usr/share/qgis/doc/api/jquery.js ] || rm debian/tmp/usr/share/qgis/doc/api/jquery.js

# Install menu pixmap

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -62,7 +62,7 @@ class QgsMapCanvas : QGraphicsView

QgsMapCanvasMap* map();

QgsMapRenderer* mapRenderer();
QgsMapRenderer* mapRenderer() /Transfer/;

//! Accessor for the canvas pixmap
// @deprecated use canvasPaintDevice()
@@ -620,11 +620,11 @@ def polygon_centroids( self ):
self.emit( SIGNAL( "runStatus( PyQt_PyObject )" ), nElement )
inGeom = inFeat.geometry()
atMap = inFeat.attributeMap()
outGeom = QgsGeometry( inGeom.centroid() )
outGeom = inGeom.centroid()
if outGeom is None:
return "math_error"
outFeat.setAttributeMap( atMap )
outFeat.setGeometry( outGeom )
outFeat.setGeometry( QgsGeometry( outGeom ) )
writer.addFeature( outFeat )
del writer
return True
@@ -326,16 +326,19 @@ def buffering( self, useField ):
allAttrs = vproviderA.attributeIndexes()
vproviderA.select( allAttrs )
fields = vproviderA.fields()
writer = QgsVectorFileWriter( self.myName, self.myEncoding,
fields, QGis.WKBPolygon, vproviderA.crs() )

writer = QgsVectorFileWriter( self.myName, self.myEncoding, fields,
QGis.WKBPolygon, vproviderA.crs() )
# check if writer was created properly, if not, return with error
if writer.hasError():
return GEOS_EXCEPT, FEATURE_EXCEPT, True, writer.errorMessage()

outFeat = QgsFeature()
inFeat = QgsFeature()
inGeom = QgsGeometry()
outGeom = QgsGeometry()
nElement = 0

# there is selection in input layer
if self.mySelectionA:
nFeat = self.vlayerA.selectedFeatureCount()
@@ -434,7 +437,6 @@ def buffering( self, useField ):
FEATURE_EXCEPT = False
# without dissolve
else:
vproviderA.rewind()
while vproviderA.nextFeature( inFeat ):
atMap = inFeat.attributeMap()
if useField:
@@ -466,10 +468,11 @@ def convex_hull(self, useField ):
allAttrsA = vproviderA.attributeIndexes()
vproviderA.select(allAttrsA)
fields = vproviderA.fields()
writer = QgsVectorFileWriter( self.myName, self.myEncoding,
fields, QGis.WKBPolygon, vproviderA.crs() )
writer = QgsVectorFileWriter( self.myName, self.myEncoding, fields,
QGis.WKBPolygon, vproviderA.crs() )
if writer.hasError():
return GEOS_EXCEPT, FEATURE_EXCEPT, True, writer.errorMessage()

inFeat = QgsFeature()
outFeat = QgsFeature()
inGeom = QgsGeometry()
@@ -533,7 +536,6 @@ def convex_hull(self, useField ):
GEOS_EXCEPT = False
# there is no selection in input layer
else:
rect = self.vlayerA.extent()
nFeat = vproviderA.featureCount()
if useField:
unique = ftools_utils.getUniqueValues( vproviderA, self.myParam )
@@ -544,8 +546,6 @@ def convex_hull(self, useField ):
hull = []
first = True
outID = 0
vproviderA.select( allAttrsA )#, rect )
#vproviderA.rewind()
while vproviderA.nextFeature( inFeat ):
atMap = inFeat.attributeMap()
idVar = atMap[ self.myParam ]
@@ -575,8 +575,6 @@ def convex_hull(self, useField ):
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
hull = []
#vproviderA.rewind()
vproviderA.select(allAttrsA)
while vproviderA.nextFeature( inFeat ):
inGeom = QgsGeometry( inFeat.geometry() )
points = ftools_utils.extractPoints( inGeom )
@@ -599,14 +597,20 @@ def dissolve( self, useField ):
vproviderA = self.vlayerA.dataProvider()
allAttrsA = vproviderA.attributeIndexes()
fields = vproviderA.fields()
writer = QgsVectorFileWriter( self.myName, self.myEncoding,
fields, vproviderA.geometryType(), vproviderA.crs() )

writer = QgsVectorFileWriter( self.myName, self.myEncoding, fields,
vproviderA.geometryType(), vproviderA.crs() )
if writer.hasError():
return GEOS_EXCEPT, FEATURE_EXCEPT, True, writer.errorMessage()

inFeat = QgsFeature()
outFeat = QgsFeature()
vproviderA.rewind()
nElement = 0
attrs = None

vproviderA.rewind()
vproviderA.select( allAttrsA )

# there is selection in input layer
if self.mySelectionA:
nFeat = self.vlayerA.selectedFeatureCount()
@@ -642,8 +646,8 @@ def dissolve( self, useField ):
for item in unique:
first = True
add = False
vproviderA.select( allAttrsA )
vproviderA.rewind()
vproviderA.select( allAttrsA )
for inFeat in selectionA:
nElement += 1
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
@@ -703,13 +707,14 @@ def dissolve( self, useField ):
for item in unique:
first = True
add = True
vproviderA.select( allAttrsA )
vproviderA.rewind()
vproviderA.select( allAttrsA )
while vproviderA.nextFeature( inFeat ):
nElement += 1
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
atMap = inFeat.attributeMap()
tempItem = atMap[ self.myParam ]

if tempItem.toString().trimmed() == item.toString().trimmed():
if first:
QgsGeometry( inFeat.geometry() )
@@ -742,22 +747,29 @@ def difference( self ):
allAttrsB = vproviderB.attributeIndexes()
vproviderB.select( allAttrsB )
fields = vproviderA.fields()

# check for crs compatibility
crsA = vproviderA.crs()
crsB = vproviderB.crs()
if not crsA.isValid() or not crsB.isValid():
crs_match = None
else:
crs_match = crsA == crsB
writer = QgsVectorFileWriter( self.myName, self.myEncoding,
fields, vproviderA.geometryType(), vproviderA.crs() )

writer = QgsVectorFileWriter( self.myName, self.myEncoding, fields,
vproviderA.geometryType(), vproviderA.crs() )
if writer.hasError():
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, writer.errorMessage()

inFeatA = QgsFeature()
inFeatB = QgsFeature()
outFeat = QgsFeature()
index = ftools_utils.createIndex( vproviderB )
nElement = 0

index = ftools_utils.createIndex( vproviderB )
vproviderB.rewind()
vproviderB.select( allAttrsB )

# there is selection in input layer
if self.mySelectionA:
nFeat = self.vlayerA.selectedFeatureCount()
@@ -829,6 +841,7 @@ def difference( self ):
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
vproviderA.rewind()
vproviderA.select( allAttrsA )
# we have selection in overlay layer
if self.mySelectionB:
selectionB = self.vlayerB.selectedFeaturesIds()
@@ -900,27 +913,35 @@ def intersect( self ):
vproviderB = self.vlayerB.dataProvider()
allAttrsB = vproviderB.attributeIndexes()
vproviderB.select( allAttrsB )

# check for crs compatibility
crsA = vproviderA.crs()
crsB = vproviderB.crs()
if not crsA.isValid() or not crsB.isValid():
crs_match = None
else:
crs_match = crsA == crsB

fields = ftools_utils.combineVectorFields( self.vlayerA, self.vlayerB )
longNames = ftools_utils.checkFieldNameLength( fields )
if not longNames.isEmpty():
message = QString( 'Following field names are longer than 10 characters:\n%1' ).arg( longNames.join( '\n' ) )
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, message
writer = QgsVectorFileWriter( self.myName, self.myEncoding,
fields, vproviderA.geometryType(), vproviderA.crs() )

writer = QgsVectorFileWriter( self.myName, self.myEncoding, fields,
vproviderA.geometryType(), vproviderA.crs() )
if writer.hasError():
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, writer.errorMessage()

inFeatA = QgsFeature()
inFeatB = QgsFeature()
outFeat = QgsFeature()
index = ftools_utils.createIndex( vproviderB )
nElement = 0

index = ftools_utils.createIndex( vproviderB )
vproviderB.rewind()
vproviderB.select( allAttrsB )

# there is selection in input layer
if self.mySelectionA:
nFeat = self.vlayerA.selectedFeatureCount()
@@ -993,6 +1014,7 @@ def intersect( self ):
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0)
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
vproviderA.rewind()
vproviderA.select( allAttrsA )
# we have selection in overlay layer
if self.mySelectionB:
selectionB = self.vlayerB.selectedFeaturesIds()
@@ -1090,12 +1112,15 @@ def union( self ):
outFeat = QgsFeature()
indexA = ftools_utils.createIndex( vproviderB )
indexB = ftools_utils.createIndex( vproviderA )
vproviderA.rewind()
vproviderA.select( allAttrsA )
vproviderB.rewind()
vproviderB.select(allAttrsB)

nFeat = vproviderA.featureCount() * vproviderB.featureCount()
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0)
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )

vproviderA.rewind()
count = 0
nElement = 0

@@ -1190,6 +1215,7 @@ def union( self ):

length = len( vproviderA.fields().values() )
vproviderB.rewind()
vproviderB.select(allAttrsB)

while vproviderB.nextFeature( inFeatA ):
add = False
@@ -1247,32 +1273,41 @@ def symetrical_difference( self ):
vproviderB = self.vlayerB.dataProvider()
allAttrsB = vproviderB.attributeIndexes()
vproviderB.select( allAttrsB )

# check for crs compatibility
crsA = vproviderA.crs()
crsB = vproviderB.crs()
if not crsA.isValid() or not crsB.isValid():
crs_match = None
else:
crs_match = crsA == crsB

fields = ftools_utils.combineVectorFields( self.vlayerA, self.vlayerB )
longNames = ftools_utils.checkFieldNameLength( fields )
if not longNames.isEmpty():
message = QString( 'Following field names are longer than 10 characters:\n%1' ).arg( longNames.join( '\n' ) )
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, message
writer = QgsVectorFileWriter( self.myName, self.myEncoding,
fields, vproviderA.geometryType(), vproviderA.crs() )

writer = QgsVectorFileWriter( self.myName, self.myEncoding, fields,
vproviderA.geometryType(), vproviderA.crs() )
if writer.hasError():
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, writer.errorMessage()

inFeatA = QgsFeature()
inFeatB = QgsFeature()
outFeat = QgsFeature()

indexA = ftools_utils.createIndex( vproviderB )
indexB = ftools_utils.createIndex( vproviderA )
vproviderA.rewind()
vproviderA.select( allAttrsA )
vproviderB.rewind()
vproviderB.select(allAttrsB)

nFeat = vproviderA.featureCount() * vproviderB.featureCount()
nElement = 0
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0)
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
vproviderA.rewind()
while vproviderA.nextFeature( inFeatA ):
nElement += 1
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
@@ -1299,8 +1334,11 @@ def symetrical_difference( self ):
except:
FEATURE_EXCEPT = False
continue

length = len( vproviderA.fields().values() )
vproviderB.rewind()
vproviderB.select(allAttrsB)

while vproviderB.nextFeature( inFeatA ):
nElement += 1
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
@@ -1340,24 +1378,32 @@ def clip( self ):
vproviderB = self.vlayerB.dataProvider()
allAttrsB = vproviderB.attributeIndexes()
vproviderB.select( allAttrsB )

# check for crs compatibility
crsA = vproviderA.crs()
crsB = vproviderB.crs()
if not crsA.isValid() or not crsB.isValid():
crs_match = None
else:
crs_match = crsA == crsB

fields = vproviderA.fields()
writer = QgsVectorFileWriter( self.myName, self.myEncoding,
fields, vproviderA.geometryType(), vproviderA.crs() )
writer = QgsVectorFileWriter( self.myName, self.myEncoding, fields,
vproviderA.geometryType(), vproviderA.crs() )
if writer.hasError():
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, writer.errorMessage()

inFeatA = QgsFeature()
inFeatB = QgsFeature()
outFeat = QgsFeature()

index = ftools_utils.createIndex( vproviderB )
vproviderA.rewind()
vproviderA.select( allAttrsA )
vproviderB.rewind()
vproviderB.select( allAttrsB )
nElement = 0

# there is selection in input layer
if self.mySelectionA:
nFeat = self.vlayerA.selectedFeatureCount()

0 comments on commit db164df

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