Skip to content
Permalink
Browse files

Merge pull request #6017 from nyalldawson/algs

[processing]  Fix some numeric parameters which should be doubles
  • Loading branch information
alexbruy committed Jan 9, 2018
2 parents 566704a + 57c2f1d commit 97c005a544d17e484b4f496486057649e2ceca80
@@ -49,9 +49,9 @@ def __init__(self):

def initParameters(self, config=None):
self.addParameter(QgsProcessingParameterNumber(self.START_DISTANCE,
self.tr('Start distance'), defaultValue=0.0))
self.tr('Start distance'), type=QgsProcessingParameterNumber.Double, defaultValue=0.0))
self.addParameter(QgsProcessingParameterNumber(self.END_DISTANCE,
self.tr('End distance'), defaultValue=0.0))
self.tr('End distance'), type=QgsProcessingParameterNumber.Double, defaultValue=0.0))

def name(self):
return 'extendlines'
@@ -68,7 +68,7 @@ def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterFeatureSource(self.BOUNDARY_LAYER,
self.tr('Boundary layer'), [QgsProcessing.TypeVectorPolygon]))
self.addParameter(QgsProcessingParameterNumber(self.STEP,
self.tr('Step'), minValue=0.0, maxValue=999999999.999999, defaultValue=100.0))
self.tr('Step'), type=QgsProcessingParameterNumber.Double, minValue=0.0, maxValue=999999999.999999, defaultValue=100.0))
self.addParameter(QgsProcessingParameterBoolean(self.USE_PERCENTAGE,
self.tr('Use % of area instead of absolute value'), defaultValue=False))

@@ -58,7 +58,7 @@ def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'extract_nodes.png'))

def tags(self):
return self.tr('create,interpolate,points,lines').split(',')
return self.tr('create,interpolate,points,lines,regular,distance,by').split(',')

def group(self):
return self.tr('Vector geometry')
@@ -73,19 +73,19 @@ def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT,
self.tr('Input layer'), [QgsProcessing.TypeVectorPolygon, QgsProcessing.TypeVectorLine]))
self.addParameter(QgsProcessingParameterNumber(self.DISTANCE,
self.tr('Distance'), minValue=0.0, defaultValue=1.0))
self.tr('Distance'), type=QgsProcessingParameterNumber.Double, minValue=0.0, defaultValue=1.0))
self.addParameter(QgsProcessingParameterNumber(self.START_OFFSET,
self.tr('Start offset'), minValue=0.0, defaultValue=0.0))
self.tr('Start offset'), type=QgsProcessingParameterNumber.Double, minValue=0.0, defaultValue=0.0))
self.addParameter(QgsProcessingParameterNumber(self.END_OFFSET,
self.tr('End offset'), minValue=0.0, defaultValue=0.0))
self.tr('End offset'), type=QgsProcessingParameterNumber.Double, minValue=0.0, defaultValue=0.0))

self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Points'), QgsProcessing.TypeVectorPoint))

def name(self):
return 'pointsalonglines'

def displayName(self):
return self.tr('Points along lines')
return self.tr('Points along geometry')

def processAlgorithm(self, parameters, context, feedback):
source = self.parameterAsSource(parameters, self.INPUT, context)

0 comments on commit 97c005a

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