]> pd.if.org Git - dumppoints/blob - t/polyrings.sql
added email address to README
[dumppoints] / t / polyrings.sql
1 begin;
2         select plan(1);
3
4
5 select results_eq(
6         $have$
7         SELECT path, ST_AsText(geom) 
8         FROM (
9           SELECT (dp.ST_DumpPoints(g.geom)).* 
10           FROM
11             (SELECT 
12                'POLYGON ((
13                         0 0, 
14                         0 9, 
15                         9 9, 
16                         9 0, 
17                         0 0
18                     ), (
19                         1 1, 
20                         1 3, 
21                         3 2, 
22                         1 1
23                     ), (
24                         7 6, 
25                         6 8, 
26                         8 8, 
27                         7 6
28                     ))'::geometry AS geom
29             ) AS g
30           ) j;
31         $have$,
32         $want$
33             values 
34                 ('{1,1}'::int[], 'POINT(0 0)'),
35                 ('{1,2}'::int[], 'POINT(0 9)'),
36                 ('{1,3}'::int[], 'POINT(9 9)'),
37                 ('{1,4}'::int[], 'POINT(9 0)'),
38                 ('{1,5}'::int[], 'POINT(0 0)'),
39                 ('{2,1}'::int[], 'POINT(1 1)'),
40                 ('{2,2}'::int[], 'POINT(1 3)'),
41                 ('{2,3}'::int[], 'POINT(3 2)'),
42                 ('{2,4}'::int[], 'POINT(1 1)'),
43                 ('{3,1}'::int[], 'POINT(7 6)'),
44                 ('{3,2}'::int[], 'POINT(6 8)'),
45                 ('{3,3}'::int[], 'POINT(8 8)'),
46                 ('{3,4}'::int[], 'POINT(7 6)');
47         $want$,
48         'polygon with rings'
49 );
50
51 select finish();
52
53 rollback;
54 \q
55