I'm trying to load a shapefile into QGIS using iface.addVectorLayer, but whenever I do this, I get an error message "Layer is not valid: etc ..."
However, if I try to load the same shapefile use the menu dialog "Add Vector Layer", it loads fine. I have loaded raster files, so I know it's not some funny with the path name.
I'm sure I'm missing something obvious here, but what?
This line works:-
layer1 = iface.addRasterLayer("H:\Mapping Stuff\NE1_50M_SR_W\NE1_50M_SR_W\NE1_50M_SR_W.tif", "basemap")
This doesn't:-
layer2 = iface.addVectorLayer("H:\Mapping Stuff\ne_50m_urban_areas\ne_50m_urban_areas.shp", "urban", "ogr")