Monday, 19 December 2016

gdal - python gdal_polygonize error


I am trying to use gdal_polygonize to create a polygon from a binary raster.



My code is:


os.system('gdal_polygonize.py ' + filename + ' -f ESRI Shapefile ' + shapefile)

where filename is a string file path with a '.tif' extension and 'shapefile' has a .shp


I am receiving the following error message:


Creating output Shapefile of format ESRI.
Traceback (most recent call last):
File "/usr/bin/gdal_polygonize.py", line 164, in
dst_ds = drv.CreateDataSource( dst_filename )
AttributeError: 'NoneType' object has no attribute 'CreateDataSource'


I have browsed the internet for help but to no avail. I am running the programme from NXclient on a windows 7 machine.


Any help would be greatly appreciated.


Becky




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...