Skip to content

Commit

Permalink
Merge pull request #1887 from gioman/fix_processing_ogr_clip
Browse files Browse the repository at this point in the history
fixes processing ogr clip tools when input is postgis/spatialite
  • Loading branch information
volaya committed Feb 6, 2015
2 parents 59b758b + 5c5cb40 commit 6f338d7
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
Expand Up @@ -56,7 +56,7 @@ def defineCharacteristics(self):


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


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


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

arguments.append(self.ogrLayerName(inLayer))

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


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


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


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


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


commands = [] commands = []
if isWindows(): if isWindows():
Expand Down

0 comments on commit 6f338d7

Please sign in to comment.