Skip to content

Commit 5a0f797

Browse files
committed
Test : add test cases for basic spatial analysis functions
1 parent 8bdedde commit 5a0f797

File tree

2 files changed

+702
-0
lines changed

2 files changed

+702
-0
lines changed

traindb-core/src/test/resources/datasets/kairos_spt/kairos.sql

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,39 @@ create table pg_test (id integer, geom st_polygon);
1818
insert into pg_test values (1, st_polyfromtext('polygon((1 10,2.555 10,2 11,1 11,1 10))',1));
1919
insert into pg_test values (2, st_polyfromtext('polygon((1 7,4.555 7,4 9,1 7))',1));
2020
insert into pg_test values (3, st_polyfromtext('polygon((1 1,3.555 1,3 3,1 3,1 1))',1));
21+
22+
-- multi point linestring polygon
23+
create table sp_test (sid int, spoint ST_POINT, sline ST_LINESTRING, spoly ST_POLYGON, smpoint ST_MULTIPOINT, smline ST_MULTILINESTRING, smpoly ST_MULTIPOLYGON);
24+
25+
insert into sp_test (sid, spoint, sline, spoly, smpoint, smline, smpoly)
26+
values (
27+
1,
28+
ST_GeomFromText('POINT(10 10)'),
29+
ST_GeomFromText('LINESTRING(10 10, 20 25, 15 40)'),
30+
ST_GeomFromText('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0), (1 1, 1 2, 2 2, 2 1, 1 1))'),
31+
ST_GeomFromText('MULTIPOINT(10 10, 30 20)'),
32+
ST_GeomFromText('MULTILINESTRING((10 10, 20 20), (20 15, 30 40))'),
33+
ST_GeomFromText('MULTIPOLYGON(((10 10, 10 20, 20 20, 20 10, 10 10)), ((40 40, 40 50, 50 50, 50 40, 40 40)))')
34+
);
35+
36+
insert into sp_test (sid, spoint, sline, spoly, smpoint, smline, smpoly)
37+
values (
38+
2,
39+
ST_GeomFromText('POINT(20 20)'),
40+
ST_GeomFromText('LINESTRING(15 15, 25 30, 20 45)'),
41+
ST_GeomFromText('POLYGON((0 3, 6 6, 9 3, 7 0, 3 0, 0 3))'),
42+
ST_GeomFromText('MULTIPOINT(20 20, 40 30)'),
43+
ST_GeomFromText('MULTILINESTRING((15 15, 25 25), (25 20, 35 45))'),
44+
ST_GeomFromText('MULTIPOLYGON(((20 20, 20 30, 30 30, 30 20, 20 20)), ((50 50, 50 60, 60 60, 60 50, 50 50)))')
45+
);
46+
47+
insert into sp_test (sid, spoint, sline, spoly, smpoint, smline, smpoly)
48+
values (
49+
3,
50+
ST_GeomFromText('POINT(30 30)'),
51+
ST_GeomFromText('LINESTRING(25 25, 35 40, 30 55, 25 25)'),
52+
ST_GeomFromText('POLYGON((2 7, 7 12, 12 12, 17 7, 12 2, 7 2, 2 7))'),
53+
ST_GeomFromText('MULTIPOINT(30 30, 50 40)'),
54+
ST_GeomFromText('MULTILINESTRING((25 25, 35 35), (35 30, 45 55))'),
55+
ST_GeomFromText('MULTIPOLYGON(((30 30, 30 40, 40 40, 40 30, 30 30)), ((60 60, 60 70, 70 70, 70 60, 60 60)))')
56+
);

0 commit comments

Comments
 (0)