Skip to content

Commit

Permalink
[processing] don't quote geometry column name (fix #16122)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Feb 7, 2017
1 parent bb4c8c0 commit 44698d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions python/plugins/processing/algs/gdal/ogr2ogrdissolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def getConsoleCommands(self):
arguments.append('sqlite')
arguments.append('-sql')

sql = "SELECT ST_Union('{}')".format(geometry)
sql = "SELECT ST_Union({})".format(geometry)

sqlOpts = ''
if fields:
Expand All @@ -119,13 +119,13 @@ def getConsoleCommands(self):
sqlOpts += ',{}'.format(field)

if count:
sqlOpts += ", COUNT('{}') AS count".format(geometry)
sqlOpts += ", COUNT({}) AS count".format(geometry)

if stats:
sqlOpts += ", SUM('{0}') AS sum_diss, MIN('{0}') AS min_diss, MAX('{0}') AS max_diss, AVG('{0}') AS avg_diss".format(statsatt)
sqlOpts += ", SUM({0}) AS sum_diss, MIN({0}) AS min_diss, MAX({0}) AS max_diss, AVG({0}) AS avg_diss".format(statsatt)

if area:
sqlOpts += ", SUM(ST_Area('{0}')) AS area_diss, ST_Perimeter(ST_Union('{0}')) AS peri_diss".format(geometry)
sqlOpts += ", SUM(ST_Area({0})) AS area_diss, ST_Perimeter(ST_Union({0})) AS peri_diss".format(geometry)

sql = '{}{} FROM {} GROUP BY {}'.format(sql, sqlOpts, layername, field)

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/MeanCoords.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def processAlgorithm(self, feedback):
weight = 1.00

if weight < 0:
raise GeoAlgorithmExecutionException(self.tr('Negative weight value found. Please fix you data and try again.'))
raise GeoAlgorithmExecutionException(self.tr('Negative weight value found. Please fix your data and try again.'))

if clazz not in means:
means[clazz] = (0, 0, 0)
Expand Down

0 comments on commit 44698d4

Please sign in to comment.