Skip to content

Commit

Permalink
fixes processing ogr clip tools when input is postgis/spatialite
Browse files Browse the repository at this point in the history
  • Loading branch information
Giovanni Manghi committed Feb 5, 2015
1 parent fb344ff commit 5c5cb40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions python/plugins/processing/algs/gdal/ogr2ogrclip.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def defineCharacteristics(self):

def processAlgorithm(self, progress):
inLayer = self.getParameterValue(self.INPUT_LAYER)
ogrLayer = self.ogrConnectionString(inLayer)
ogrLayer = self.ogrConnectionString(inLayer)[1:-1]
clipLayer = self.getParameterValue(self.CLIP_LAYER)
ogrClipLayer = self.ogrConnectionString(clipLayer)

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

arguments.append(output)
arguments.append(ogrLayer)

arguments.append(self.ogrLayerName(inLayer))

commands = []
if isWindows():
commands = ['cmd.exe', '/C ', 'ogr2ogr.exe',
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/algs/gdal/ogr2ogrclipextent.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def defineCharacteristics(self):

def processAlgorithm(self, progress):
inLayer = self.getParameterValue(self.INPUT_LAYER)
ogrLayer = self.ogrConnectionString(inLayer)
ogrLayer = self.ogrConnectionString(inLayer)[1:-1]
clipExtent = self.getParameterValue(self.CLIP_EXTENT)
ogrclipExtent = self.ogrConnectionString(clipExtent)

Expand All @@ -74,14 +74,14 @@ def processAlgorithm(self, progress):
arguments.append(regionCoords[2])
arguments.append(regionCoords[1])
arguments.append(regionCoords[3])
#arguments.append('-spat')
#arguments.append(ogrclipExtent)
arguments.append('-clipsrc spat_extent')

if len(options) > 0:
arguments.append(options)

arguments.append(output)
arguments.append(ogrLayer)
arguments.append(self.ogrLayerName(inLayer))

commands = []
if isWindows():
Expand Down

0 comments on commit 5c5cb40

Please sign in to comment.