[Qgis-developer] Problem using vector data provider in python

Chris Crook ccrook at linz.govt.nz
Tue Dec 14 15:54:05 EST 2010


Thanks Ivan

It looks like that could work, but I'm hoping to short circuit that a bit, as in the end what I want are QgsFeature objects.  

The data provider is getting exactly what I want, except that it is not exposing (to Python) the functions from QgsVectorDataProvider, only those from the base QgsDataProvider class. 

I guess if there is no better way I could use the ogr module, but I'll end up replicating in Python a bunch of code that is already written in the OGR data provider, which seems a bit wasteful :-)

Cheers
Chris

-----Original Message-----
From: Ivan Mincik [mailto:ivan.mincik at gmail.com] 
Sent: Wednesday, 15 December 2010 9:42 a.m.
To: Chris Crook
Cc: qgis-developer at lists.osgeo.org
Subject: Re: [Qgis-developer] Problem using vector data provider in python

> I'm wondering if it is possible to use a QgsVectorDataProvider independently from a map layer in Python.  For example, I'd like to open a GML file and read features, etc from it without creating a map layer.

Hi Chris,
if You want to read GML in some script, You can use GDAL python bindings.
"from osgeo import ogr"

Ivan
______________________________________________________________________________________________________

This message contains information, which is confidential and may be subject to legal privilege. 
If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message.
If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info at linz.govt.nz) and destroy the original message.
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.

Thank you.
______________________________________________________________________________________________________


More information about the Qgis-developer mailing list