Skip to content

Commit

Permalink
[processing][gdal] Spatial extent filter for import to postgis
Browse files Browse the repository at this point in the history
should be optional
  • Loading branch information
nyalldawson committed Dec 8, 2017
1 parent 846400c commit 2d4a465
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
4 changes: 1 addition & 3 deletions python/plugins/processing/algs/gdal/OgrToPostGis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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 + '"'
Expand Down
3 changes: 0 additions & 3 deletions python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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 + '"'
Expand Down

0 comments on commit 2d4a465

Please sign in to comment.