Skip to content

Commit 5c5cb40

Browse files
author
Giovanni Manghi
committedFeb 5, 2015
fixes processing ogr clip tools when input is postgis/spatialite
1 parent fb344ff commit 5c5cb40

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed
 

‎python/plugins/processing/algs/gdal/ogr2ogrclip.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def defineCharacteristics(self):
5656

5757
def processAlgorithm(self, progress):
5858
inLayer = self.getParameterValue(self.INPUT_LAYER)
59-
ogrLayer = self.ogrConnectionString(inLayer)
59+
ogrLayer = self.ogrConnectionString(inLayer)[1:-1]
6060
clipLayer = self.getParameterValue(self.CLIP_LAYER)
6161
ogrClipLayer = self.ogrConnectionString(clipLayer)
6262

@@ -74,7 +74,8 @@ def processAlgorithm(self, progress):
7474

7575
arguments.append(output)
7676
arguments.append(ogrLayer)
77-
77+
arguments.append(self.ogrLayerName(inLayer))
78+
7879
commands = []
7980
if isWindows():
8081
commands = ['cmd.exe', '/C ', 'ogr2ogr.exe',

‎python/plugins/processing/algs/gdal/ogr2ogrclipextent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def defineCharacteristics(self):
5757

5858
def processAlgorithm(self, progress):
5959
inLayer = self.getParameterValue(self.INPUT_LAYER)
60-
ogrLayer = self.ogrConnectionString(inLayer)
60+
ogrLayer = self.ogrConnectionString(inLayer)[1:-1]
6161
clipExtent = self.getParameterValue(self.CLIP_EXTENT)
6262
ogrclipExtent = self.ogrConnectionString(clipExtent)
6363

@@ -74,14 +74,14 @@ def processAlgorithm(self, progress):
7474
arguments.append(regionCoords[2])
7575
arguments.append(regionCoords[1])
7676
arguments.append(regionCoords[3])
77-
#arguments.append('-spat')
78-
#arguments.append(ogrclipExtent)
77+
arguments.append('-clipsrc spat_extent')
7978

8079
if len(options) > 0:
8180
arguments.append(options)
8281

8382
arguments.append(output)
8483
arguments.append(ogrLayer)
84+
arguments.append(self.ogrLayerName(inLayer))
8585

8686
commands = []
8787
if isWindows():

0 commit comments

Comments
 (0)
Please sign in to comment.