SELECT 'f2', topology.addFace('tt', 'POLYGON((10 10, 20 10, 20 0, 10 0, 10 10))');
-- Check added faces
-SELECT face_id, mbr from tt.face ORDER by face_id;
+SELECT face_id, Box2d(mbr) from tt.face ORDER by face_id;
-- Check linking
SELECT edge_id, left_face, right_face from tt.edge ORDER by edge_id;
EXECUTE
''CREATE TABLE '' || quote_ident(atopology) || ''.face (''
|| ''face_id SERIAL,''
- || ''mbr BOX2D,''
|| '' CONSTRAINT face_primary_key PRIMARY KEY(face_id)''
|| '');'';
+
+ -- Add mbr column to the face table
+ EXECUTE
+ ''SELECT AddGeometryColumn(''||quote_literal(atopology)
+ ||'',''''face'''',''''mbr'''',''||quote_literal(srid)
+ ||'',''''POLYGON'''',''''2'''')'';
+
-------------} END OF face CREATION
------- Default (world) face
EXECUTE ''INSERT INTO '' || quote_ident(atopology) || ''.face(face_id) VALUES(0);'';
+ ------- GiST index on face
+ EXECUTE ''CREATE INDEX face_gist ON ''
+ || quote_ident(atopology)
+ || ''.face using gist (mbr gist_geometry_ops);'';
+
------- GiST index on node
EXECUTE ''CREATE INDEX node_gist ON ''
|| quote_ident(atopology)