Hi list, I'm trying to load a vector layer (shapefile) using PyQGIS and especially QgsVectorLayer constructor. I had a look at the following link to start with : http://www.qgis.org/pyqgis-cookbook/intro.html#python-applications and also : http://www.qgis.org/pyqgis-cookbook/loadlayer.html#vector-layers
So my script looks like : *QgsApplication.setPrefixPath("/usr",True)* *QgsApplication.initQgis()* *myLayer = QgsVectorLayer("/tmp/data.gboundaries.shp","gboundaries","ogr")* But I get this error message : "Data source is invalid" and my layer is invalid. However, it is working when I launch it in the QGIS python console. Do I need to set/export any variable outside of QGIS to use the ogr provider? Does anybody has any clue about my problem? FYI, I'm working on Ubuntu 10.10, with Python 2.6 and QGIS 1.6 (from the packages). Thanks for your help, Cheers, Mathieu
_______________________________________________ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user