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

should be optional
This commit is contained in:
Nyall Dawson 2017-12-08 15:24:30 +10:00
parent 846400cb70
commit 2d4a465212
2 changed files with 1 additions and 6 deletions

View File

@ -122,7 +122,7 @@ class OgrToPostGis(GdalAlgorithm):
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 @@ class OgrToPostGis(GdalAlgorithm):
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 + '"'

View File

@ -183,7 +183,6 @@ class Ogr2OgrToPostGisList(GdalAlgorithm):
# 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 @@ class Ogr2OgrToPostGisList(GdalAlgorithm):
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 + '"'