Skip to content

Commit

Permalink
Merge branch 'master' of github.com:qgis/Quantum-GIS
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed May 25, 2012
2 parents 88a319a + 40c34d4 commit db164df
Show file tree
Hide file tree
Showing 22 changed files with 2,505 additions and 2,416 deletions.
2 changes: 1 addition & 1 deletion debian/rules
Expand Up @@ -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
Expand Down
94 changes: 47 additions & 47 deletions doc/TRANSLATORS

Large diffs are not rendered by default.

3,974 changes: 1,965 additions & 2,009 deletions i18n/qgis_de.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion python/gui/qgsmapcanvas.sip
Expand Up @@ -62,7 +62,7 @@ class QgsMapCanvas : QGraphicsView

QgsMapCanvasMap* map();

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

//! Accessor for the canvas pixmap
// @deprecated use canvasPaintDevice()
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/fTools/tools/doGeometry.py
Expand Up @@ -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
Expand Down
100 changes: 73 additions & 27 deletions python/plugins/fTools/tools/doGeoprocessing.py
Expand Up @@ -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()
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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 )
Expand All @@ -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 ]
Expand Down Expand Up @@ -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 )
Expand All @@ -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()
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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() )
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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

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

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

while vproviderB.nextFeature( inFeatA ):
add = False
Expand Down Expand Up @@ -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 )
Expand All @@ -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 )
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit db164df

Please sign in to comment.