I am trying to use gdal:contour script in Qgis console and then script. Here is code which I tried write to console.

raster = QgsRasterLayer('C:/Users/Bulva.user/Desktop/test_raster.asc', "DEM")
processing.runalg("gdalogr:contour", raster, 1.0, "ELEV", None, "C:/Users/Bulva.user/Desktop/contour.shp")

the output of console is:

{'OUTPUT_VECTOR': 'C:/Users/Bulva.user/Desktop/countour.shp'}

but there is no shapefile as output. I tried processing.runandload and there is a problem with loading layer, because shapefile wasn't generated.

I tried it few days ago and I swear it worked but today I have no idea why it is not working.

This my log in Log Messages Panel > Processing:

2016-05-11T11:45:35 2   Problem with OTB installation: OTB was not found or is not correctly installed
2016-05-11T11:47:25 0   GDAL execution console output
            Usage: gdal_contour [-b <band>] [-a <attribute_name>] [-3d] [-inodata]

                                [-snodata n] [-f <formatname>] [-i <interval>]

                                [-f <formatname>] [[-dsco NAME=VALUE] ...] [[-lco NAME=VALUE] ...]

                                [-off <offset>] [-fl <level> <level>...]

                                [-nln <outlayername>] [-q]

                                <src_filename> <dst_filename>

            FAILURE: Too many command options. 

and in OGR:

2016-05-11T11:47:25 1   Data source is invalid ()
2016-05-11T11:47:25 1   Data source is invalid ()
  • Your path C:/Users/Bulva.user/is problematic (. is non ASCII)
    – gene
    May 11, 2016 at 15:19
  • Yes, it is working on other computer. Is there any way how start algorithm on computer where is name of user with "."? I can't change this name. Or I have to create folder in Users? You can put your previous comment as answer, I will mark it. Thanks for reply.
    – Bulva
    May 12, 2016 at 9:13
  • It is working on new qgis version
    – Bulva
    May 13, 2016 at 14:23

1 Answer 1


How @gene said, the problem is '.' in my username (C:Users/firstname.secondname) on computer.

In QGIS 2.14 and 2.16 it is working fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.