File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
python/plugins/fTools/tools Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ def getVectorLayerByName( myName ):
203
203
return layer
204
204
else :
205
205
return None
206
-
206
+
207
207
# Return QgsMapLayer from a layer name ( as string )
208
208
def getMapLayerByName ( myName ):
209
209
layermap = QgsMapLayerRegistry .instance ().mapLayers ()
@@ -249,15 +249,7 @@ def addShapeToCanvas( shapefile_path ):
249
249
250
250
# Return all unique values in field based on field index
251
251
def getUniqueValues ( provider , index ):
252
- allAttrs = provider .attributeIndexes ()
253
- provider .select ( allAttrs )
254
- f = QgsFeature ()
255
- values = []
256
- check = []
257
- while provider .nextFeature ( f ):
258
- if not f .attributeMap ()[ index ].toString () in check :
259
- values .append ( f .attributeMap ()[ index ] )
260
- check .append ( f .attributeMap ()[ index ].toString () )
252
+ values = provider .uniqueValues ( index )
261
253
return values
262
254
263
255
# Generate a save file dialog with a dropdown box for choosing encoding style
You can’t perform that action at this time.
0 commit comments