I'm attempting to create contours from a raster DEM (provided by USGS). I open the dialog at Raster > Extraction > Contour, choose the input level, leave the default Band number of Band 1, set an interval of 10 feet, attribute name of ELEV, offset from zero of 0.0000, and select an output directory and file using the dialog from the ellipsis next to the "Contours" field. However, I get an error message

ERROR 1: Failed to create directory "C:/Users/Username/Documents/QGIS/Cougar/Vector/w001001.shp" for shapefile datastore.

I noted that the GDAL command is:

gdal_contour -b 1 -a ELEV -i 10.0 -f "ESRI Shapefile" "C:\\Users\\Username\\Documents\\QGIS\\Cougar\\raster\\1-3degree2014elev\\grdn45w123_13\\FEET-w001001.tif" "\"C:/Users/Username/Documents/QGIS/Cougar/Vector/w001001.shp\"" (This has been lightly edited to avoid exposing my username; otherwise, an exact cut-and-paste)

This appears to me to have a malformed path "\"C:/Users/Username/Documents/QGIS/Cougar/Vector/w001001.shp\"", and when I copy this into a command line, and edit the command to read:

gdal_contour -b 1 -a ELEV -i 10.0 -f "ESRI Shapefile" "C:\\Users\\Username\\Documents\\QGIS\\Cougar\\raster\\1-3degree2014elev\\grdn45w123_13\\FEET-w001001.tif" "C:/Users/Username/Documents/QGIS/Cougar/Vector/w001001.shp"

the command runs as expected and produces output which I can successfully add to my project in in the QGIS GUI. What am I missing in the Contour dialog to produce proper output? Obviously, I can work around whatever I'm doing wrong, but I'd prefer to not have to mess with a bunch of cutting and pasting and editing on the command line if I can help it. The same thing occurs when trying to use the "Run as a Batch Process..." dialog.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.