Skip to content
Permalink
Browse files

Fix layer handling in import to postgis algs

  • Loading branch information
nyalldawson committed Dec 8, 2017
1 parent 2d4a465 commit b578f8af353c2775eed0a43f1ab96ca7735f91da
@@ -185,7 +185,6 @@ def getConnectionString(self, parameters, context):
return GdalUtils.escapeAndJoin(arguments)

def getConsoleCommands(self, parameters, context, feedback, executing=True):
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()
@@ -233,7 +232,7 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments.append('"')
arguments.append(dimstring)
arguments.append(ogrLayer)
arguments.append(GdalUtils.ogrLayerName(inLayer))
arguments.append(layername)
if index:
arguments.append(indexstring)
if launder:
@@ -254,7 +253,7 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
elif primary_key is not None:
arguments.append("-lco FID=" + primary_key)
if len(table) == 0:
table = GdalUtils.ogrLayerName(inLayer).lower()
table = layername.lower()
if schema:
table = '{}.{}'.format(schema, table)
arguments.append('-nln')
@@ -253,7 +253,7 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
elif primary_key is not None:
arguments.append("-lco FID=" + primary_key)
if len(table) == 0:
table = GdalUtils.ogrLayerName(inLayer).lower()
table = layername.lower()
if schema:
table = '{}.{}'.format(schema, table)
arguments.append('-nln')

0 comments on commit b578f8a

Please sign in to comment.
You can’t perform that action at this time.