Skip to content
Permalink
Browse files

Merge pull request #713 from minorua/ftools

fTools fixes
  • Loading branch information
NathanW2 committed Jul 14, 2013
2 parents 9b4f461 + 6088fd7 commit f6c057e5c3c617c7620e41db34594fba10a085fa
Showing with 6 additions and 35 deletions.
  1. +6 −27 python/plugins/fTools/tools/doGeoprocessing.py
  2. +0 −8 python/plugins/fTools/tools/doSpatialJoin.py
@@ -903,11 +903,6 @@ def intersect( self ):
else:
crs_match = crsA == crsB
fields = ftools_utils.combineVectorFields( self.vlayerA, self.vlayerB )
longNames = ftools_utils.checkFieldNameLength( fields )
if longNames:
message = self.tr('Following field names are longer than 10 characters:\n%s') % ( '\n'.join(longNames) )
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, message

writer = QgsVectorFileWriter( self.myName, self.myEncoding, fields,
vproviderA.geometryType(), vproviderA.crs() )
if writer.hasError():
@@ -955,8 +950,7 @@ def intersect( self ):
gList = ftools_utils.getGeomType( geom.wkbType() )
if int_geom.wkbType() in gList:
outFeat.setGeometry( int_geom )
atMapA.extend( atMapB )
outFeat.setAttributes( atMapA )
outFeat.setAttributes( atMapA + atMapB )
writer.addFeature( outFeat )
except:
FEATURE_EXCEPT = False
@@ -987,8 +981,7 @@ def intersect( self ):
gList = ftools_utils.getGeomType( geom.wkbType() )
if int_geom.wkbType() in gList:
outFeat.setGeometry( int_geom )
atMapA.extend( atMapB )
outFeat.setAttributes( atMapA )
outFeat.setAttributes( atMapA + atMapB )
writer.addFeature( outFeat )
except:
EATURE_EXCEPT = False
@@ -1027,8 +1020,7 @@ def intersect( self ):
gList = ftools_utils.getGeomType( geom.wkbType() )
if int_geom.wkbType() in gList:
outFeat.setGeometry( int_geom )
atMapA.extend( atMapB )
outFeat.setAttributes( atMapA )
outFeat.setAttributes( atMapA + atMapB )
writer.addFeature( outFeat )
except:
FEATURE_EXCEPT = False
@@ -1061,8 +1053,7 @@ def intersect( self ):
gList = ftools_utils.getGeomType( geom.wkbType() )
if int_geom.wkbType() in gList:
outFeat.setGeometry( int_geom )
atMapA.extend( atMapB )
outFeat.setAttributes( atMapA )
outFeat.setAttributes( atMapA + atMapB )
writer.addFeature( outFeat )
except:
FEATURE_EXCEPT = False
@@ -1088,11 +1079,6 @@ def union( self ):
crs_match = crsA == crsB

fields = ftools_utils.combineVectorFields( self.vlayerA, self.vlayerB )
longNames = ftools_utils.checkFieldNameLength( fields )
if longNames:
message = self.tr( 'Following field names are longer than 10 characters:\n%s' ) % ( "\n".join(longNames) )
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, message

writer = QgsVectorFileWriter( self.myName, self.myEncoding, fields,
vproviderA.geometryType(), vproviderA.crs() )
if writer.hasError():
@@ -1163,8 +1149,7 @@ def union( self ):
int_geom = QgsGeometry( i )
try:
outFeat.setGeometry( int_geom )
atMapA.extend( atMapB )
outFeat.setAttributes( atMapA )
outFeat.setAttributes( atMapA + atMapB )
writer.addFeature( outFeat )
except Exception, err:
FEATURE_EXCEPT = False
@@ -1177,8 +1162,7 @@ def union( self ):
if int_geom.wkbType() in gList:
try:
outFeat.setGeometry( int_geom )
atMapA.extend( atMapB )
outFeat.setAttributes( atMapA )
outFeat.setAttributes( atMapA + atMapB )
writer.addFeature( outFeat )
except Exception, err:
FEATURE_EXCEPT = False
@@ -1274,11 +1258,6 @@ def symetrical_difference( self ):
crs_match = crsA == crsB

fields = ftools_utils.combineVectorFields( self.vlayerA, self.vlayerB )
longNames = ftools_utils.checkFieldNameLength( fields )
if longNames:
message = self.tr( 'Following field names are longer than 10 characters:\n%s' ) % ( "\n".join(longNames) )
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, message

writer = QgsVectorFileWriter( self.myName, self.myEncoding, fields,
vproviderA.geometryType(), vproviderA.crs() )
if writer.hasError():
@@ -146,14 +146,6 @@ def compute(self, inName, joinName, outName, summary, sumList, keep, progressBar
seq = range(0, len(fieldList1))
fieldList1 = dict(zip(seq, fieldList1))

# check for correct field names
print fieldList1
longNames = ftools_utils.checkFieldNameLength( fieldList1.values() )
if len( longNames ) > 0:
QMessageBox.warning( self, self.tr( 'Incorrect field names' ),
self.tr( 'No output will be created.\nFollowing field names are longer than 10 characters:\n%s' ) % ( "\n".join(longNames) ) )
return False

sRs = provider1.crs()
progressBar.setValue(13)
check = QFile(self.shapefileName)

0 comments on commit f6c057e

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