On Mon, Apr 4, 2011 at 1:10 PM, Marco Lechner - FOSSGIS e.V. <[email protected]> wrote: > Hi, > > I'm trying to load several vector layers (shp and spatialite) using > PyQGIS but the Layers are never valid. what am I doing wrong? According > to http://www.qgis.org/pyqgis-cookbook/loadlayer.html it should be al > right. The used shape can be regularly opened from QGIS without any > problems. Opening geotiffs works without problems.
Hi you have to call QgsApplication.setPrefixPath() prior to call to initQgis(). It is covered here: http://www.qgis.org/pyqgis-cookbook/intro.html#using-pyqgis-in-custom-application Otherwise it fails to find data providers and thus it's impossible to load layers. Regards Martin _______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
