File: addface2.5d.sql

package info (click to toggle)
postgis 2.5.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 75,792 kB
  • sloc: ansic: 139,314; sql: 136,281; xml: 48,954; sh: 4,906; perl: 4,509; makefile: 2,897; python: 1,198; yacc: 441; cpp: 305; lex: 132
file content (24 lines) | stat: -rw-r--r-- 760 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
set client_min_messages to ERROR;

-- Test with zero tolerance

SELECT topology.CreateTopology('tt3d', -1, 0, true) > 0;

-- Create 4 edges

SELECT 'e1',  topology.addEdge('tt3d', 'LINESTRING(0 0 10, 10 0 20)');
SELECT 'e2',  topology.addEdge('tt3d', 'LINESTRING(10 0 20, 10 10 30)');
SELECT 'e3',  topology.addEdge('tt3d', 'LINESTRING(0 10 20, 10 10 30)');
SELECT 'e4',  topology.addEdge('tt3d', 'LINESTRING(0 0 10, 0 10 20)');

-- Register a face with no holes
SELECT 'f1',  topology.addFace('tt3d', 'POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))');

-- Check added faces
SELECT face_id, st_asewkt(mbr) from tt3d.face ORDER by face_id;

-- Check linking
SELECT edge_id, left_face, right_face from tt3d.edge ORDER by edge_id;

SELECT topology.DropTopology('tt3d');