Skip to content

Commit

Permalink
[processing] ensure that output temporary directory exists (fix #21701)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Apr 20, 2019
1 parent 8c21a9e commit c706cde
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/qgis/HypsometricCurves.py
Expand Up @@ -95,6 +95,8 @@ def processAlgorithm(self, parameters, context, feedback):
percentage = self.parameterAsBoolean(parameters, self.USE_PERCENTAGE, context)

outputPath = self.parameterAsString(parameters, self.OUTPUT_DIRECTORY, context)
if not os.path.exists(outputPath):
os.makedirs(outputPath)

rasterDS = gdal.Open(rasterPath, gdal.GA_ReadOnly)
geoTransform = rasterDS.GetGeoTransform()
Expand Down Expand Up @@ -138,7 +140,7 @@ def processAlgorithm(self, parameters, context, feedback):
continue

fName = os.path.join(
outputPath, 'hystogram_%s_%s.csv' % (source.sourceName(), f.id()))
outputPath, 'histogram_{}_{}.csv'.format(source.sourceName(), f.id()))

ogrGeom = ogr.CreateGeometryFromWkt(intersectedGeom.asWkt())
bbox = intersectedGeom.boundingBox()
Expand Down

0 comments on commit c706cde

Please sign in to comment.