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

Nathan Woodrow madmanwoo at gmail.com
Sat Nov 30 14:50:21 PST 2013


Maaza,

Are you using QGIS 2.0?

- Nathan


On Sun, Dec 1, 2013 at 6:27 AM, mmekuria <sailmcm at yahoo.com> wrote:

> 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.
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20131201/f62708bf/attachment.html>


More information about the Qgis-developer mailing list