Skip to content

Commit

Permalink
Merge pull request #9836 from alexbruy/fix-hypsometry
Browse files Browse the repository at this point in the history
[processing] ensure that output temporary directory exists (fix #21701)
  • Loading branch information
alexbruy committed Apr 21, 2019
2 parents 8c21a9e + c706cde commit a744ddb
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 a744ddb

Please sign in to comment.