[Qgis-developer] Nearest Neighbor List and Vector Layer Selection

mmekuria sailmcm at yahoo.com
Sat Nov 30 12:27:52 PST 2013


I was using Python Spatial Index and select from a vector layer using the
result from nearest neighbor (list) and get error messages saying it does
not recognized the list. I see in the API the input to the select 

QList< QgsFeatureId > QgsSpatialIndex::nearestNeighbor ( QgsPoint  	point,
int  	neighbors ) 

and the vector select allows input of feature Id's but the documentation is
very scantily covered to give what the python representation might be

void QgsVectorLayer::select 	( 	const QgsFeatureIds &  	featureIds	) 	

The format for the  QgsFeatureIds is typedef QSet<QgsFeatureId>
QgsFeatureIds

How can I coerce this magical transformation using soemthing similar in
Python (may be a Set) ? I tried making a Python Set but Vector layer Select
refuses to accept it. 

How do I transform QList to QSet<QgsFeatureId> in Python?

Thank you, 
		



-----
Maaza Christos, PhD
www.Axumcorp.com

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Nearest-Neighbor-List-and-Vector-Layer-Selection-tp5092015.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.


More information about the Qgis-developer mailing list