Skip to content
Permalink
Browse files

[processing] use numeric parameter for buffer distance

  • Loading branch information
alexbruy committed Nov 12, 2016
1 parent 256efcc commit e1ee477c40a7797ea8d233d7151b4eda0ed36f2a
@@ -27,6 +27,7 @@

from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterString
from processing.core.parameters import ParameterNumber
from processing.core.parameters import ParameterBoolean
from processing.core.parameters import ParameterTableField
from processing.core.outputs import OutputVector
@@ -59,8 +60,10 @@ def defineCharacteristics(self):
self.addParameter(ParameterString(self.GEOMETRY,
self.tr('Geometry column name ("geometry" for Shapefiles, may be different for other formats)'),
'geometry', optional=False))
self.addParameter(ParameterString(self.DISTANCE,
self.tr('Buffer distance'), '1000', optional=False))
self.addParameter(ParameterNumber(self.DISTANCE,
self.tr('Buffer distance'),
0.0, 99999999.999999, 1000.0,
optional=False))
self.addParameter(ParameterBoolean(self.DISSOLVEALL,
self.tr('Dissolve all results'), False))
self.addParameter(ParameterTableField(self.FIELD,
@@ -124,4 +127,4 @@ def getConsoleCommands(self):
return commands

def commandName(self):
return "ogr2ogr"
return 'ogr2ogr'
@@ -76,7 +76,7 @@ tests:
name: OGR buffer lines
params:
DISSOLVEALL: false
DISTANCE: '1'
DISTANCE: 1.0
GEOMETRY: geometry
INPUT_LAYER:
name: lines.gml
@@ -91,7 +91,7 @@ tests:
name: OGR basic polygon buffer
params:
DISSOLVEALL: false
DISTANCE: '0.5'
DISTANCE: 0.5
GEOMETRY: geometry
INPUT_LAYER:
name: polys.gml
@@ -106,7 +106,7 @@ tests:
name: OGR polygon buffer with dissolve
params:
DISSOLVEALL: true
DISTANCE: '0.5'
DISTANCE: 0.5
GEOMETRY: geometry
INPUT_LAYER:
name: polys.gml

0 comments on commit e1ee477

Please sign in to comment.
You can’t perform that action at this time.