Skip to content
Permalink
Browse files

[processing][gdal] Spatial extent filter for import to postgis

should be optional
  • Loading branch information
nyalldawson committed Dec 8, 2017
1 parent 846400c commit 2d4a4652127960808279d93456427f7ef4cfc15b
@@ -122,7 +122,7 @@ def initAlgorithm(self, config=None):
self.tr('Maximum distance between 2 nodes (densification)'),
defaultValue='', optional=True))
self.addParameter(QgsProcessingParameterExtent(self.SPAT,
self.tr('Select features by extent (defined in input layer CRS)')))
self.tr('Select features by extent (defined in input layer CRS)'), optional=True))
self.addParameter(QgsProcessingParameterBoolean(self.CLIP,
self.tr('Clip the input layer using the above (rectangle) extent'),
defaultValue=False))
@@ -203,8 +203,6 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
simplify = self.parameterAsString(parameters, self.SIMPLIFY, context)
segmentize = self.parameterAsString(parameters, self.SEGMENTIZE, context)
spat = self.parameterAsExtent(parameters, self.SPAT, context)
if spat.isNull():
spat = inLayer.sourceExtent()
clip = self.parameterAsBool(parameters, self.CLIP, context)
where = self.parameterAsString(parameters, self.WHERE, context)
wherestring = '-where "' + where + '"'
@@ -183,7 +183,6 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
# to get credentials input when needed
uri = GeoDB(uri=uri).uri

inLayer = self.parameterAsSource(parameters, self.INPUT, context)
ogrLayer, layername = self.getOgrCompatibleSource(self.INPUT, parameters, context, feedback, executing)
shapeEncoding = self.parameterAsString(parameters, self.SHAPE_ENCODING, context)
ssrs = self.parameterAsCrs(parameters, self.S_SRS, context).authid()
@@ -201,8 +200,6 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
simplify = self.parameterAsString(parameters, self.SIMPLIFY, context)
segmentize = self.parameterAsString(parameters, self.SEGMENTIZE, context)
spat = self.parameterAsExtent(parameters, self.SPAT, context)
if spat.isNull():
spat = inLayer.sourceExtent()
clip = self.parameterAsBool(parameters, self.CLIP, context)
where = self.parameterAsString(parameters, self.WHERE, context)
wherestring = '-where "' + where + '"'

0 comments on commit 2d4a465

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