From 2d4a4652127960808279d93456427f7ef4cfc15b Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 8 Dec 2017 15:24:30 +1000 Subject: [PATCH] [processing][gdal] Spatial extent filter for import to postgis should be optional --- python/plugins/processing/algs/gdal/OgrToPostGis.py | 4 +--- python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/python/plugins/processing/algs/gdal/OgrToPostGis.py b/python/plugins/processing/algs/gdal/OgrToPostGis.py index 3585eff5513..5a0dbe90bc9 100644 --- a/python/plugins/processing/algs/gdal/OgrToPostGis.py +++ b/python/plugins/processing/algs/gdal/OgrToPostGis.py @@ -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 + '"' diff --git a/python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py b/python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py index 28b668edd02..f28cc1571f7 100644 --- a/python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py +++ b/python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py @@ -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 + '"'