Skip to content
Permalink
Browse files
[processing] Some fixes to handling of uppercase/lowercase geometry c…
…olumn names
  • Loading branch information
nyalldawson committed May 20, 2014
1 parent ed076d0 commit ec3da40d2629f9ba9c5837396ead3045f6d5d001
Showing with 9 additions and 7 deletions.
  1. +9 −7 python/plugins/processing/algs/admintools/ImportIntoPostGIS.py
@@ -92,20 +92,22 @@ def processAlgorithm(self, progress):
if not geomColumn:
geomColumn = 'the_geom'

uri = QgsDataSourceURI()
uri.setConnection(host, str(port), database, username, password)
if primaryKeyField:
uri.setDataSource(schema, table, geomColumn, '', primaryKeyField)
else:
uri.setDataSource(schema, table, geomColumn, '')

options = {}
if overwrite:
options['overwrite'] = True
if convertLowerCase:
options['lowercaseFieldNames'] = True
geomColumn = geomColumn.lower()
if dropStringLength:
options['dropStringConstraints'] = True

uri = QgsDataSourceURI()
uri.setConnection(host, str(port), database, username, password)
if primaryKeyField:
uri.setDataSource(schema, table, geomColumn, '', primaryKeyField)
else:
uri.setDataSource(schema, table, geomColumn, '')

layerUri = self.getParameterValue(self.INPUT)
layer = dataobjects.getObjectFromUri(layerUri)
(ret, errMsg) = QgsVectorLayerImport.importLayer(

0 comments on commit ec3da40

Please sign in to comment.