[Qgis-developer] Python Oracle getFeatures non working on non-geometric tables
mederic.ribreux at medspx.homenet.org
Wed Dec 10 02:51:36 PST 2014
I've been further this morning... You just need to build a
QgsFeatureRequest which grabs the NoGeometry features.
for f in
This behavior seems to be specific to Oracle NoGeometry QgsVectorLayers.
I have made tests under PostGIS and Spatialite and you can use the
getFeatures() method without specifying a QgsFeatureRequest to grab all
the features of the layer.
Should I file a bug report on Oracle provider ?
Le 2014-12-09 17:47, mederic.ribreux a écrit :
> I am trying to iterate over a non geographic table under PyQGis. The
> table is stored in an Oracle database and I use QGis Api to get the
> data (table is opened in a QGis project with Oracle provider). I have
> added primary key constraint to this table but I am not able to
> iterate through its features with the getFeatures() method. The
> following snippet always returns nothing:
> layer =
> for f in layer.getFeatures():
> print f
> I have tried with a geographic layer and there is no problem on this
> side because the above snippets prints a line for every feature in the
> table. I have also tried with opening the geographic table without
> geometry (geometry is "No Geometry"). In this configuration, I am not
> able to get access to the features...
> I have tried to reproduce this on a PostgreSQL/PostGIS server and
> there is no bug: I am able to iterate over a non-geographic layer
> (even a geographic layer declared as non-geographic).
> Is this a problem with the Oracle provider or just me having forgotten
> something in the table ?
> Best regards
More information about the Qgis-developer