Skip to content

Commit

Permalink
[processing] fixed creation of vector layer as PostGIS Table
Browse files Browse the repository at this point in the history
fixes error introduced in last commit
  • Loading branch information
volaya committed Nov 9, 2015
1 parent b2b6823 commit 55c18a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/plugins/processing/tools/vector.py
Expand Up @@ -494,7 +494,7 @@ def _runSQL(sql):
table=uri.table().lower(), schema=uri.schema(), srid=crs.authid().split(":")[-1],
typmod=GEOM_TYPE_MAP[geometryType].upper()))

self.layer = QgsVectorLayer(uri.uri(), uri.table(), "spatialite")
self.layer = QgsVectorLayer(uri.uri(), uri.table(), "postgres")
self.writer = self.layer.dataProvider()
elif self.destination.startswith(self.SPATIALITE_LAYER_PREFIX):
self.isNotFileBased = True
Expand All @@ -517,7 +517,7 @@ def _runSQL(sql):
fieldsdesc = ",".join('%s %s' % (f.name(),
TYPE_MAP_SPATIALITE_LAYER.get(f.type(), "VARCHAR"))
for f in fields)

_runSQL("DROP TABLE IF EXISTS %s" % uri.table().lower())
_runSQL("CREATE TABLE %s (%s)" % (uri.table().lower(), fieldsdesc))
_runSQL("SELECT AddGeometryColumn('{table}', 'the_geom', {srid}, '{typmod}', 2)".format(
Expand Down

0 comments on commit 55c18a5

Please sign in to comment.