@@ -124,7 +124,7 @@ def outFile( self ):
124
124
( self .shapefileName , self .encoding ) = ftools_utils .saveDialog ( self )
125
125
if self .shapefileName is None or self .encoding is None :
126
126
return
127
- self .outShape .setText ( QString ( self .shapefileName ) )
127
+ self .outShape .setText ( self .shapefileName )
128
128
129
129
def manageGui ( self ):
130
130
if self .myFunction == 1 : # Buffer
@@ -403,7 +403,7 @@ def buffering( self, useField ):
403
403
# with dissolve
404
404
if self .myMerge :
405
405
first = True
406
- fit = vproviderA .getFeatures ()
406
+ fit = vproviderA .getFeatures ()
407
407
while fit .nextFeature ( inFeat ):
408
408
atMap = inFeat .attributes ()
409
409
if useField :
@@ -434,7 +434,7 @@ def buffering( self, useField ):
434
434
FEATURE_EXCEPT = False
435
435
# without dissolve
436
436
else :
437
- fit = vproviderA .getFeatures ()
437
+ fit = vproviderA .getFeatures ()
438
438
while fit .nextFeature ( inFeat ):
439
439
atMap = inFeat .attributes ()
440
440
if useField :
@@ -491,7 +491,7 @@ def convex_hull(self, useField ):
491
491
for inFeat in selectionA :
492
492
atMap = inFeat .attributes ()
493
493
idVar = atMap [ self .myParam ]
494
- if idVar .toString (). trimmed () == i .toString (). trimmed ():
494
+ if idVar .strip () == i .strip ():
495
495
if first :
496
496
outID = idVar
497
497
first = False
@@ -506,9 +506,9 @@ def convex_hull(self, useField ):
506
506
outGeom = tmpGeom .convexHull ()
507
507
outFeat .setGeometry ( outGeom )
508
508
(area , perim ) = self .simpleMeasure ( outGeom )
509
- outFeat .setAttribute ( 0 , QVariant ( outID ) )
510
- outFeat .setAttribute ( 1 , QVariant ( area ) )
511
- outFeat .setAttribute ( 2 , QVariant ( perim ) )
509
+ outFeat .setAttribute ( 0 , outID )
510
+ outFeat .setAttribute ( 1 , area )
511
+ outFeat .setAttribute ( 2 , perim )
512
512
writer .addFeature ( outFeat )
513
513
except :
514
514
GEOS_EXCEPT = False
@@ -547,7 +547,7 @@ def convex_hull(self, useField ):
547
547
while fitA .nextFeature ( inFeat ):
548
548
atMap = inFeat .attributes ()
549
549
idVar = atMap [ self .myParam ]
550
- if idVar .toString (). trimmed () == i .toString (). trimmed ():
550
+ if idVar .strip () == i .strip ():
551
551
if first :
552
552
outID = idVar
553
553
first = False
@@ -562,9 +562,9 @@ def convex_hull(self, useField ):
562
562
outGeom = tmpGeom .convexHull ()
563
563
outFeat .setGeometry ( outGeom )
564
564
(area , perim ) = self .simpleMeasure ( outGeom )
565
- outFeat .setAttribute ( 0 , QVariant ( outID ) )
566
- outFeat .setAttribute ( 1 , QVariant ( area ) )
567
- outFeat .setAttribute ( 2 , QVariant ( perim ) )
565
+ outFeat .setAttribute ( 0 , outID )
566
+ outFeat .setAttribute ( 1 , area )
567
+ outFeat .setAttribute ( 2 , perim )
568
568
writer .addFeature ( outFeat )
569
569
except :
570
570
GEOS_EXCEPT = False
@@ -573,7 +573,7 @@ def convex_hull(self, useField ):
573
573
self .emit ( SIGNAL ( "runStatus(PyQt_PyObject)" ), 0 )
574
574
self .emit ( SIGNAL ( "runRange(PyQt_PyObject)" ), ( 0 , nFeat ) )
575
575
hull = []
576
- fitA = vproviderA .getFeatures ()
576
+ fitA = vproviderA .getFeatures ()
577
577
while fitA .nextFeature ( inFeat ):
578
578
inGeom = QgsGeometry ( inFeat .geometry () )
579
579
points = ftools_utils .extractPoints ( inGeom )
@@ -816,7 +816,7 @@ def difference( self ):
816
816
# we have selection in overlay layer
817
817
if self .mySelectionB :
818
818
selectionB = self .vlayerB .selectedFeaturesIds ()
819
- fitA = vproviderA .getFeatures ()
819
+ fitA = vproviderA .getFeatures ()
820
820
while fitA .nextFeature ( inFeatA ):
821
821
nElement += 1
822
822
add = True
@@ -893,7 +893,7 @@ def intersect( self ):
893
893
fields = ftools_utils .combineVectorFields ( self .vlayerA , self .vlayerB )
894
894
longNames = ftools_utils .checkFieldNameLength ( fields )
895
895
if not longNames .isEmpty ():
896
- message = QString ( 'Following field names are longer than 10 characters:\n %s' ) % ( '\n ' .join (longNames ) )
896
+ message = self . tr ( 'Following field names are longer than 10 characters:\n %s' ) % ( '\n ' .join (longNames ) )
897
897
return GEOS_EXCEPT , FEATURE_EXCEPT , crs_match , message
898
898
899
899
writer = QgsVectorFileWriter ( self .myName , self .myEncoding , fields ,
@@ -992,7 +992,7 @@ def intersect( self ):
992
992
# we have selection in overlay layer
993
993
if self .mySelectionB :
994
994
selectionB = self .vlayerB .selectedFeaturesIds ()
995
- fitA = vproviderA .getFeatures ()
995
+ fitA = vproviderA .getFeatures ()
996
996
while fitA .nextFeature ( inFeatA ):
997
997
nElement += 1
998
998
self .emit ( SIGNAL ( "runStatus(PyQt_PyObject)" ), nElement )
@@ -1078,7 +1078,7 @@ def union( self ):
1078
1078
fields = ftools_utils .combineVectorFields ( self .vlayerA , self .vlayerB )
1079
1079
longNames = ftools_utils .checkFieldNameLength ( fields )
1080
1080
if not longNames .isEmpty ():
1081
- message = QString ( 'Following field names are longer than 10 characters:\n %s' ) % ( "\n " .join (longNames ) )
1081
+ message = self . tr ( 'Following field names are longer than 10 characters:\n %s' ) % ( "\n " .join (longNames ) )
1082
1082
return GEOS_EXCEPT , FEATURE_EXCEPT , crs_match , message
1083
1083
1084
1084
writer = QgsVectorFileWriter ( self .myName , self .myEncoding , fields ,
@@ -1264,7 +1264,7 @@ def symetrical_difference( self ):
1264
1264
fields = ftools_utils .combineVectorFields ( self .vlayerA , self .vlayerB )
1265
1265
longNames = ftools_utils .checkFieldNameLength ( fields )
1266
1266
if not longNames .isEmpty ():
1267
- message = QString ( 'Following field names are longer than 10 characters:\n %s' ) % ( "\n " .join (longNames ) )
1267
+ message = self . tr ( 'Following field names are longer than 10 characters:\n %s' ) % ( "\n " .join (longNames ) )
1268
1268
return GEOS_EXCEPT , FEATURE_EXCEPT , crs_match , message
1269
1269
1270
1270
writer = QgsVectorFileWriter ( self .myName , self .myEncoding , fields ,
0 commit comments