Sunday, 14 October 2018

qgis - Problem loading vector layer (pyQGIS)


I've installed the qgis on ubuntu 12.04 following the instructions on http://hub.qgis.org/projects/quantum-gis/wiki/Download. I am trying to test the Python API and try to do the follwoing


from qgis.core import *
layer = QgsVectorLayer("coast.shp", "coast_shp", "ogr")

But layer.isValid() returns false. Any ideas why it might happen?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...