[Qgis-developer] New Vector API

Martin Dobias wonder.sk at gmail.com
Fri Jan 4 13:19:57 PST 2013


Hi Matthias

thanks for your mail.

On Thu, Jan 3, 2013 at 10:37 AM, Matthias Kuhn <matthias.kuhn at gmx.ch> wrote:
>
> You've been talking about updating to PyQt4 SIP version 2. I noticed this
> change did not yet happen. What are your plans regarding this update?

Yes, the plans are still there. I'm only wondering what would be the
best time to switch - right now within the branch or a bit later once
the branch is merged and the new code settles down a bit? I can see a
slight advantage of the latter approach of having a greater chance of
separating problems caused by the merge and problems caused by the SIP
API change, but I do not have a strong opinion here.


> I'm also looking forward to seeing QgsFeatureRequest support QgsExpression,
> I think this is not yet supported?

No, it's not yet supported. It should be possible to add features like
this one easily even later without breaking any API. It is not my
priority now, of course any contributions in that direction are
welcome! (and also for support of native expressions for postgres,
spatialite and other DBMSs)


> PS:
> I've just been able to segfault:
>
> a = dataProvider.getFeatures( QgsFeatureRequest().setFilterFid( featureId )
> )
> a.rewind()
> a.next()

Which provider was that? Just tried with OGR and memory providers and it worked.


> PPS:
> Another strange thing (maybe related), calling next() directly on a fid
> filter returns a feature, storing into a QgsFeatureIterator and calling next
> on this throws a StopIteration:
>
> dataProvider.getFeatures(QgsFeatureRequest().setFilterFid( featureId )
> ).next()
> <qgis.core.QgsFeature object at 0xaa027a0>
>
> features = dataProvider.getFeatures(QgsFeatureRequest().setFilterFid(
> featureId ) )
> f = features.next()
> Traceback (most recent call last):
>   File "/home/kk/.qgis//python/plugins/remotedebug/pysrc/pydevd_exec.py",
> line 2, in Exec
>     exec exp in global_vars, local_vars
>   File "<console>", line 1, in <module>
> StopIteration

Again, works for me correctly with OGR and memory provider - maybe
some provider other has that problem.


Regards
Martin


More information about the Qgis-developer mailing list