Skip to main content
4 of 5
edited tags
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

imac: add vector layer in python

I used the following line to try and add a vector shapefile to my qgis map, though it gives me "invalid layer" errors. Does anyone see something I don't?

iface.addVectorLayer(r"/Users/pgcseismolab/Desktop/jaden_pgc_archive/Wells/WD/Shapefiles/wd_14/wd14.shp","test","ogr")

I'm fairly new to python- do I have to define a variable before running this command? *on Mac OSX

jrowley
  • 247
  • 1
  • 8