[Qgis-developer] [Python] QgsFeatureIterator for geometryless PostgreSQL-Layer
Jürgen E. Fischer
jef at norbit.de
Mon Apr 29 01:37:11 PDT 2013
On Wed, 24. Apr 2013 at 00:21:53 +0200, Martin Dobias wrote:
> > Which only moves the problem upward. Maybe we should handle setFilterFid
> > requests like the old featureAtId.
> Could you be more specific what would that mean implementation-wise?
Handling the setFilterFid requests so that they don't interfere with other
iterators - thereby reviving any code that implied that featureAtId is possible
while select()/nextFeature() is ongoing.
> Right, I thought it was the same cursor, but in fact they were called
> differently ("qgisf[N]" vs "qgisfid[N]"). But still with OGR there is
> not guarantee that it will work - if the driver does not implement
> random access to features. Not sure about other providers...
But judging by the lack of tickets that complain about this, I suppose with
frequently used OGR drivers it worked.
> I would like to address multiple iterators in the 2.1 release together with
> threaded rendering.
That's what I thought - ie. the closing of active iterators is a temporary
kludge. But I didn't think that we would release 2.0 with that (at least not
after I found that this was introducing regressions).
> Right now it seems that all those problems lead to the handling of changed
> geometries within vector layer's feature iterator
> (fetchNextChangedGeomFeature()). We could update that code to first finish
> iterating over features from data provider and only after that fetch
> remaining features (by ID) with changed geometries that have not been
> considered before (in the main loop) - at that time the internal provider's
> iterator will be closed already, so there will be no collision.
> Does that sound good to you?
Not really - sorry ;)
To me it sounds like extending the kludge. And identifying the affected code
is probably not that easy either - I suppose just a few were tagged with
> This change should also lower the amount of queries to the provider: if the
> feature with changed geometry is still in the filter rectangle, no
> superfluous "feature at id" queries will be issued.
Some of the code (eg. some stuff in fTools) probably should be reworked anyway.
The question is who has enough time to work on any of this...
Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31
Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50
Software Engineer D-26506 Norden http://www.norbit.de
committ(ed|ing) to Quantum GIS IRC: jef on FreeNode
norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH
Rheinstrasse 13, 26506 Norden
GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502
More information about the Qgis-developer