]> pd.if.org Git - dumppoints/blob - t/polygon.sql
initial commit
[dumppoints] / t / polygon.sql
1 begin;
2         select plan(1);
3
4 select results_eq(
5         $have$
6         SELECT path, ST_AsText(geom) 
7         FROM (
8           SELECT (dp.ST_DumpPoints(g.geom)).* 
9           FROM
10             (SELECT 
11                'POLYGON ((
12                         0 0, 
13                         0 9, 
14                         9 9, 
15                         9 0, 
16                         0 0
17                     ))'::geometry AS geom
18             ) AS g
19           ) j;
20         $have$,
21         $want$
22             values 
23                 ('{1,1}'::int[], 'POINT(0 0)'),
24                 ('{1,2}'::int[], 'POINT(0 9)'),
25                 ('{1,3}'::int[], 'POINT(9 9)'),
26                 ('{1,4}'::int[], 'POINT(9 0)'),
27                 ('{1,5}'::int[], 'POINT(0 0)');
28         $want$,
29         'polygon'
30 );
31
32 select finish();
33
34 rollback;
35 \q
36