Skip to content
Permalink
Browse files

[processing] fixed creation of vector layer as PostGIS Table

fixes error introduced in last commit
  • Loading branch information
volaya committed Nov 9, 2015
1 parent b2b6823 commit 55c18a5e458d81199e59be1925ee2b236168d111
Showing with 2 additions and 2 deletions.
  1. +2 −2 python/plugins/processing/tools/vector.py
@@ -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
@@ -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(

0 comments on commit 55c18a5

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