Skip to content
Permalink
Browse files

Removes limitation on maximum no of selectable features. Fixes #2503.…

… Patch thanks to alexbruy.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13020 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer
cfarmer committed Mar 8, 2010
1 parent da14012 commit 73f32cf32da06792558200dd49740972a52bad19
Showing with 11 additions and 9 deletions.
  1. +11 −9 python/plugins/fTools/tools/doSubsetSelect.py
@@ -1,8 +1,8 @@
#-----------------------------------------------------------
#
#
# Random selection within subsets
#
# A QGIS plugin for randomly selecting features from
# A QGIS plugin for randomly selecting features from
# within multiple user defined subsets based on an input field.
#
# Copyright (C) 2008 Carson Farmer
@@ -11,23 +11,23 @@
# WEB : www.geog.uvic.ca/spar/carson
#
#-----------------------------------------------------------
#
#
# licensed under the terms of GNU GPL 2
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#
#--------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
@@ -42,7 +42,7 @@ def __init__(self, iface):
self.iface = iface
# Set up the user interface from Designer.
self.setupUi(self)
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)
self.setWindowTitle(self.tr("Random selection within subsets"))
# populate layer list
self.progressBar.setValue(0)
@@ -58,6 +58,8 @@ def update(self, inputLayer):
changedField = self.getFieldList(changedLayer)
for i in changedField:
self.inField.addItem(unicode(changedField[i].name()))
maxFeatures = changedLayer.dataProvider().featureCount()
self.spnNumber.setMaximum( maxFeatures )

def accept(self):
if self.inShape.currentText() == "":
@@ -158,7 +160,7 @@ def getFieldList(self, vlayer):
return myFields

def getUniqueValues(self, provider, index):
allAttrs = provider.attributeIndexes()
allAttrs = provider.attributeIndexes()
provider.select(allAttrs)
feat = QgsFeature()
values = []

0 comments on commit 73f32cf

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