[Qgis-developer] qgis+python bindings: failed to load vector layer

Luca Mandolesi mandoluca at gmail.com
Tue Jul 24 17:08:28 EDT 2007


Hi to alls!

I've installed qgis svn under Mac OS X 10.4 and I've tried to use the
tutorial by Martin Dobias.


I can view the evry raster images but if I try to load a vector layer
I recive tis message:

Failed to load

I think the problem is in this point of my code,

    layerPath =  "/Users/heywood/Desktop/shape_dir/shapefile.shp"
    layerName = "shapefile"
    layerProvider = "ogr"
    # create layer
    layer = QgsVectorLayer(layerPath, layerName, layerProvider)

    if not layer.isValid():
      return



but I don't understand where is the mystake and beacause the layer
isn't valid. The problm can be the path, the layer name or the
provider?

thanks a lot


bye bye



More information about the Qgis-developer mailing list