Re: [Qgis-user] Select QGSFeature with given ID

2017-10-20 Thread Pat Hin
Hello Etienne,

 

wonderful. 

A lot of great tipps at least to review own code.

I have seen it before and the method .setSubsetOfAttributes has

saved me minutes of calculation times :)

 

pat

 

Gesendet: Freitag, 20. Oktober 2017 um 08:39 Uhr
Von: "Etienne Trimaille" 
An: "Pat Hin" 
Cc: rich...@duif.net, "qgis-userlists.osgeo.org" 
Betreff: Re: [Qgis-user] Select QGSFeature with given ID


Have a look at this good blog post from Nyall with QgsFeatureRequest:
http://nyalldawson.net/2016/10/speeding-up-your-pyqgis-scripts/


 
2017-10-20 8:21 GMT+02:00 Pat Hin <ph...@gmx.de>:




Hello

 

many thanks.

 

the method ".setFilterExpression" has been the one i am looking for :)

 

Many thanks :)

 

Pat

 

Gesendet: Donnerstag, 19. Oktober 2017 um 20:39 Uhr
Von: "Richard Duivenvoorde" <rdmaili...@duif.net>
An: "Pat Hin" <ph...@gmx.de>, "Luigi Pirelli" <lui...@gmail.com>
Cc: "qgis-userlists.osgeo.org" <qgis-user@lists.osgeo.org>
Betreff: Re: [Qgis-user] Select QGSFeature with given ID

On 19-10-17 18:27, Pat Hin wrote:
> Thank you
>  
> i have done it but struggeld. but wil have a second try

Did you found

http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/

already?

http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/vector.html#iterating-over-a-subset-of-features

Regards,

Richard Duivenvoorde





___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user





___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Select QGSFeature with given ID

2017-10-19 Thread Etienne Trimaille
Have a look at this good blog post from Nyall with QgsFeatureRequest:
http://nyalldawson.net/2016/10/speeding-up-your-pyqgis-scripts/

2017-10-20 8:21 GMT+02:00 Pat Hin :

> Hello
>
> many thanks.
>
> the method ".setFilterExpression" has been the one i am looking for :)
>
> Many thanks :)
>
> Pat
>
> *Gesendet:* Donnerstag, 19. Oktober 2017 um 20:39 Uhr
> *Von:* "Richard Duivenvoorde" 
> *An:* "Pat Hin" , "Luigi Pirelli" 
> *Cc:* "qgis-userlists.osgeo.org" 
> *Betreff:* Re: [Qgis-user] Select QGSFeature with given ID
> On 19-10-17 18:27, Pat Hin wrote:
> > Thank you
> >
> > i have done it but struggeld. but wil have a second try
>
> Did you found
>
> http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/
>
> already?
>
> http://docs.qgis.org/testing/en/docs/pyqgis_developer_
> cookbook/vector.html#iterating-over-a-subset-of-features
>
> Regards,
>
> Richard Duivenvoorde
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Select QGSFeature with given ID

2017-10-19 Thread Pat Hin
Hello

 

many thanks.

 

the method ".setFilterExpression" has been the one i am looking for :)

 

Many thanks :)

 

Pat

 

Gesendet: Donnerstag, 19. Oktober 2017 um 20:39 Uhr
Von: "Richard Duivenvoorde" 
An: "Pat Hin" , "Luigi Pirelli" 
Cc: "qgis-userlists.osgeo.org" 
Betreff: Re: [Qgis-user] Select QGSFeature with given ID

On 19-10-17 18:27, Pat Hin wrote:
> Thank you
>  
> i have done it but struggeld. but wil have a second try

Did you found

http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/

already?

http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/vector.html#iterating-over-a-subset-of-features

Regards,

Richard Duivenvoorde


___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Select QGSFeature with given ID

2017-10-19 Thread Richard Duivenvoorde
On 19-10-17 18:27, Pat Hin wrote:
> Thank you
>  
> i have done it but struggeld. but wil have a second try

Did you found

http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/

already?

http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/vector.html#iterating-over-a-subset-of-features

Regards,

Richard Duivenvoorde
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Select QGSFeature with given ID

2017-10-19 Thread Pat Hin

Thank you

 

i have done it but struggeld. but wil have a second try

 

thanks

 

Gesendet: Donnerstag, 19. Oktober 2017 um 18:14 Uhr
Von: "Luigi Pirelli" 
An: "Pat Hin" 
Cc: "qgis-userlists.osgeo.org" 
Betreff: Re: [Qgis-user] Select QGSFeature with given ID

explore documentation about QgsFreatureRequest

QgsVectorLayer.getFeatures(QgsFreatureRequest(...))

regards
Luigi Pirelli

**
* Boundless QGIS Support/Development: lpirelli AT boundlessgeo DOT com
* LinkedIn: https://www.linkedin.com/in/luigipirelli
* Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli
* GitHub: https://github.com/luipir
* Mastering QGIS 2nd Edition:
* https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition
**


On 19 October 2017 at 15:45, Pat Hin  wrote:
> Hello,
>
> i have a vector layer with more than 25k QGSFeature elements in it.
> By now i run over it by a loop and stop at the Feature with the given ID.
> But i know this amateurish and worser very slow if i need to run for it
> several times.
> So how could i do this more elegant and faster?
>
> Many thanks
> Pat
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user



___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Select QGSFeature with given ID

2017-10-19 Thread Luigi Pirelli
explore documentation about QgsFreatureRequest

QgsVectorLayer.getFeatures(QgsFreatureRequest(...))

regards
Luigi Pirelli

**
* Boundless QGIS Support/Development: lpirelli AT boundlessgeo DOT com
* LinkedIn: https://www.linkedin.com/in/luigipirelli
* Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli
* GitHub: https://github.com/luipir
* Mastering QGIS 2nd Edition:
* 
https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition
**


On 19 October 2017 at 15:45, Pat Hin  wrote:
> Hello,
>
> i have a vector layer with more than 25k QGSFeature elements in it.
> By now i run over it by a loop and stop at the Feature with the given ID.
> But i know this amateurish and worser very slow if i need to run for it
> several times.
> So how could i do this more elegant and faster?
>
> Many thanks
> Pat
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] Select QGSFeature with given ID

2017-10-19 Thread Pat Hin
Hello,

 

i have a vector layer with more than 25k QGSFeature elements in it.

By now i run over it by a loop and stop at the Feature with the given ID.

But i know this amateurish and worser very slow if i need to run for it

several times.

So how could i do this more elegant and faster?

 

Many thanks

Pat
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user