Skip to content

Commit

Permalink
Fix loading of face layers after breaking it with 73b4986
Browse files Browse the repository at this point in the history
Fix #9510 again
  • Loading branch information
Sandro Santilli committed Feb 8, 2014
1 parent 6dd0cbe commit 188b373
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -116,9 +116,9 @@ def run(item, action, mainwindow):
# face
geomcast = ''
if supportsTypmod:
geomcast = '::geometry(multipolygon,%s)' % toposrid
geomcast = '::geometry(polygon,%s)' % toposrid
layer = db.toSqlLayer(u'SELECT face_id, topology.ST_GetFaceGeometry(%s, face_id)%s as geom ' \
'FROM %s.face WHERE face_id > 0' % (geomcast, quoteStr(toponame), quoteId(toponame)),
'FROM %s.face WHERE face_id > 0' % (quoteStr(toponame), geomcast, quoteId(toponame)),
'geom', 'face_id', u'%s.face' % toponame)
layer.loadNamedStyle(os.path.join(template_dir, 'face.qml'))
registry.addMapLayers([layer])
Expand All @@ -131,7 +131,7 @@ def run(item, action, mainwindow):
if supportsTypmod:
geomcast = '::geometry(point,%s)' % toposrid
layer = db.toSqlLayer(u'SELECT face_id, ST_PointOnSurface(topology.ST_GetFaceGeometry(%s, face_id))%s as geom ' \
'FROM %s.face WHERE face_id > 0' % (geomcast ,quoteStr(toponame), quoteId(toponame)),
'FROM %s.face WHERE face_id > 0' % (quoteStr(toponame), geomcast, quoteId(toponame)),
'geom', 'face_id', u'%s.face_seed' % toponame)
layer.loadNamedStyle(os.path.join(template_dir, 'face_seed.qml'))
registry.addMapLayers([layer])
Expand Down

0 comments on commit 188b373

Please sign in to comment.