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 <module>
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
gdal_polygonize.py my_tif.tif -f "ESRI Shapefile" my_shapefile.shp
to be sure that the os.system call is not the problem. You also forgot the double quotes for "ESRI Shapefile"