@@ -122,8 +122,10 @@ def run(item, action, mainwindow):
122
122
face_extent = layer .extent ()
123
123
124
124
# face geometry
125
- sql = u'SELECT face_id, topology.ST_GetFaceGeometry(%s, face_id) as geom ' \
126
- 'FROM %s.face WHERE face_id > 0' % (quoteStr (toponame ), quoteId (toponame ))
125
+ sql = u'SELECT face_id, topology.ST_GetFaceGeometry(%s,' \
126
+ 'face_id)::geometry(polygon, %s) as geom ' \
127
+ 'FROM %s.face WHERE face_id > 0' % \
128
+ (quoteStr (toponame ), quoteId (toponame ), toposrid )
127
129
uri .setDataSource ('' , u'(%s\n )' % sql , 'geom' , '' , 'face_id' )
128
130
uri .setSrid (toposrid )
129
131
uri .setWkbType (QGis .WKBPolygon )
@@ -136,8 +138,11 @@ def run(item, action, mainwindow):
136
138
legend .setLayerExpanded (layer , False )
137
139
138
140
# face_seed
139
- sql = u'SELECT face_id, ST_PointOnSurface(topology.ST_GetFaceGeometry(%s, face_id)) as geom ' \
140
- 'FROM %s.face WHERE face_id > 0' % (quoteStr (toponame ), quoteId (toponame ))
141
+ sql = u'SELECT face_id, ST_PointOnSurface(' \
142
+ 'topology.ST_GetFaceGeometry(%s,' \
143
+ 'face_id))::geometry(point, %s) as geom ' \
144
+ 'FROM %s.face WHERE face_id > 0' % \
145
+ (quoteStr (toponame ), quoteId (toponame ), toposrid )
141
146
uri .setDataSource ('' , u'(%s)' % sql , 'geom' , '' , 'face_id' )
142
147
uri .setSrid (toposrid )
143
148
uri .setWkbType (QGis .WKBPoint )
0 commit comments