Changeset: bba66b37e91e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bba66b37e91e
Added Files:
geom/sql/Tests/pg_regression/Tests/regress_bdpoly.sql
geom/sql/Tests/pg_regression/Tests/regress_management.sql
geom/sql/Tests/pg_regression/Tests/regress_ogc.sql
geom/sql/Tests/pg_regression/Tests/regress_ogc_cover.sql
geom/sql/Tests/pg_regression/Tests/regress_ogc_cover.stable.err
geom/sql/Tests/pg_regression/Tests/regress_ogc_cover.stable.out
geom/sql/Tests/pg_regression/Tests/regress_ogc_prep.sql
geom/sql/Tests/pg_regression/Tests/regress_proj.sql
Modified Files:
geom/sql/Tests/pg_regression/Tests/All
Branch: geo
Log Message:
pg_regress: regress_ogc, regress_ogc_cover, regress_ogc_prep, regress_bdpoly,
regress_proj, regress_management
diffs (truncated from 837 to 300 lines):
diff --git a/geom/sql/Tests/pg_regression/Tests/All
b/geom/sql/Tests/pg_regression/Tests/All
--- a/geom/sql/Tests/pg_regression/Tests/All
+++ b/geom/sql/Tests/pg_regression/Tests/All
@@ -71,5 +71,17 @@
#iscollection #Uknown Functions: st_iscollection
+#regress_ogc #Unknown Functions: st_buffer(geometry, int, int), st_snaptogrid,
st_relate(geometry, geometry), box3d, st_polygonize, st_linemerge
+ #segmentation fault at select 'ST_NumGeometries',
ST_NumGeometries(ST_GeomFromText('LINESTRING(0 0, 1 1)'));
+
+regress_ogc_cover
+
+#regress_ogc_prep #Unknown Functions: st_containsproperly
+
+#regress_bdpoly #Unknown Functions: st_buildarea, ST_BdMPolyFromText
+
+#regress_proj #Unknown Functions: st_snaptogrid
+
+#regress_management #Functions not applicable in MOnetDB
removeTmpFiles
diff --git a/geom/sql/Tests/pg_regression/Tests/regress_bdpoly.sql
b/geom/sql/Tests/pg_regression/Tests/regress_bdpoly.sql
new file mode 100644
--- /dev/null
+++ b/geom/sql/Tests/pg_regression/Tests/regress_bdpoly.sql
@@ -0,0 +1,31 @@
+-- Repeat all tests with the new function names.
+-- Single 3dz polygon w/out holes
+select 'BuildArea', ST_Equals(ST_buildarea(ST_GeomFromText('LINESTRING(0 0 2,
10 0 4, 10 10 6, 0 10 8, 0 0 10)', 2)), ST_GeomFromText('POLYGON((0 0 10,0 10
8,10 10 6,10 0 4,0 0 2))', 2));
+
+-- Single 3dz polygon with holes
+select 'BuildArea', ST_Equals(ST_buildarea(ST_GeomFromText('MULTILINESTRING((0
0 2, 10 0 4, 10 10 6, 0 10 8, 0 0 10),(2 2 1, 2 4 2, 4 4 3, 4 2 4, 2 2 5),(5 5
10, 5 7 9, 7 7 8, 7 5 7, 5 5 6))', 3)), ST_GeomFromText('POLYGON((0 0 10,0 10
8,10 10 6,10 0 4,0 0 2),(2 2 5,4 2 4,4 4 3,2 4 2,2 2 1),(5 5 6,7 5 7,7 7 8,5 7
9,5 5 10))', 3));
+
+-- Single 3dm polygon with holes (M is currently discarded)
+select 'BuildArea',
ST_Equals(ST_buildarea(ST_GeomFromText('MULTILINESTRINGM((0 0 2, 10 0 4, 10 10
6, 0 10 8, 0 0 10),(2 2 1, 2 4 2, 4 4 3, 4 2 4, 2 2 5),(5 5 10, 5 7 9, 7 7 8, 7
5 7, 5 5 6))', 3)), ST_GeomFromText('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4
2,4 4,2 4,2 2),(5 5,7 5,7 7,5 7,5 5))', 3));
+
+-- Single 4d polygon with holes (M is currently discarded)
+select 'BuildArea', ST_Equals(ST_buildarea(ST_GeomFromText('MULTILINESTRING((0
0 2 9, 10 0 4 9, 10 10 6 9, 0 10 8 9, 0 0 10 9),(2 2 1 9, 2 4 2 9, 4 4 3 9, 4 2
4 9, 2 2 5 9),(5 5 10 9, 5 7 9 9, 7 7 8 9, 7 5 7 9, 5 5 6 9))',
3)),ST_GeomFromText('POLYGON((0 0 10,0 10 8,10 10 6,10 0 4,0 0 2),(2 2 5,4 2
4,4 4 3,2 4 2,2 2 1),(5 5 6,7 5 7,7 7 8,5 7 9,5 5 10))', 3));
+
+-- Multi 4d polygon with holes (M is currently discarded)
+select 'BuildArea', ST_Equals(ST_buildarea(ST_GeomFromText('MULTILINESTRING(
(0 0 2 9, 10 0 4 9, 10 10 6 9, 0 10 8 9, 0 0 10 9), (2 2 1 9, 2 4 2 9, 4 4 3 9,
4 2 4 9, 2 2 5 9), (5 5 10 9, 5 7 9 9, 7 7 8 9, 7 5 7 9, 5 5 6 9), (20 0 2 9,30
0 4 9,30 10 6 9,20 10 8 9,20 0 10 9), (22 2 1 9,22 4 2 9,24 4 3 9,24 2 4 9,22 2
5 9), (25 5 10 9,25 7 9 9,27 7 8 9,27 5 7 9,25 5 6 9))', 3)),
ST_GeomFromText('MULTIPOLYGON(((0 0 10,0 10 8,10 10 6,10 0 4,0 0 2),(2 2 5,4 2
4,4 4 3,2 4 2,2 2 1),(5 5 6,7 5 7,7 7 8,5 7 9,5 5 10)),((20 0 10,20 10 8,30 10
6,30 0 4,20 0 2),(22 2 5,24 2 4,24 4 3,22 4 2,22 2 1),(25 5 6,27 5 7,27 7 8,25
7 9,25 5 10)))', 3));
+
+-- Multi 2d polygon with holes (OGC doesn't support higher dims)
+select 'BdMPolyFromText', ST_Equals(ST_BdMPolyFromText('MULTILINESTRING( (0 0,
10 0, 10 10, 0 10, 0 0), (2 2, 2 4, 4 4, 4 2, 2 2), (5 5, 5 7, 7 7, 7 5, 5 5),
(20 0,30 0,30 10,20 10,20 0), (22 2,22 4,24 4,24 2,22 2), (25 5,25 7,27 7,27
5,25 5))', 3), ST_GeomFromText('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(2 2,4
2,4 4,2 4,2 2),(5 5,7 5,7 7,5 7,5 5)),((20 0,20 10,30 10,30 0,20 0),(22 2,24
2,24 4,22 4,22 2),(25 5,27 5,27 7,25 7,25 5)))', 3));
+
+-- Single 2d polygon with holes (OGC doesn't support higher dims)
+select 'BdPolyFromText', ST_Equals(ST_BdPolyFromText('MULTILINESTRING((0 0, 10
0, 10 10, 0 10, 0 0),(2 2, 2 4, 4 4, 4 2, 2 2),(5 5, 5 7, 7 7, 7 5, 5 5))', 3),
ST_GeomFromText('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2),(5 5,7
5,7 7,5 7,5 5))', 3));
+
+-- Invalid input (not a linestring) to BdPolyFromText and BdMPolyFromText
+select ST_BdPolyFromText('POINT(0 0)', 3);
+select ST_BdMPolyFromText('POINT(0 0)', 3);
+
+-- MultiPolygon forming input to BdPolyFromText
+select ST_BdPolyFromText('MULTILINESTRING( (0 0, 10 0, 10 10, 0 10, 0 0), (2
2, 2 4, 4 4, 4 2, 2 2), (5 5, 5 7, 7 7, 7 5, 5 5), (20 0,30 0,30 10,20 10,20
0), (22 2,22 4,24 4,24 2,22 2), (25 5,25 7,27 7,27 5,25 5))', 3);
+
+-- SinglePolygon forming input to BdMPolyFromText
+select 'BdMPolyFromText', ST_asewkt(ST_BdMPolyFromText('MULTILINESTRING((0 0,
10 0, 10 10, 0 10, 0 0),(2 2, 2 4, 4 4, 4 2, 2 2),(5 5, 5 7, 7 7, 7 5, 5 5))',
3));
diff --git a/geom/sql/Tests/pg_regression/Tests/regress_management.sql
b/geom/sql/Tests/pg_regression/Tests/regress_management.sql
new file mode 100644
--- /dev/null
+++ b/geom/sql/Tests/pg_regression/Tests/regress_management.sql
@@ -0,0 +1,11 @@
+-- $Id: regress_management.sql 10326 2012-09-25 02:45:28Z robe $
+-- Test the populate_geometry_columns,DropGeometryTable etc --
+\set VERBOSITY terse
+SET client_min_messages TO warning;
+DELETE FROM spatial_ref_sys WHERE srid = 4326;
+INSERT INTO spatial_ref_sys ( srid, proj4text ) VALUES( 4326, '+proj=longlat
+ellps=WGS84 +datum=WGS84 +no_defs');
+CREATE TABLE test_pt(gid SERIAL PRIMARY KEY, geom geometry);
+INSERT INTO test_pt(geom) VALUES(ST_GeomFromEWKT('SRID=4326;POINT M(1 2 3)'));
+SELECT populate_geometry_columns('test_pt'::regclass);
+SELECT 'The result: ' || DropGeometryTable('test_pt');
+SELECT 'Unexistant: ' || DropGeometryTable('unexistent'); -- see ticket #861
diff --git a/geom/sql/Tests/pg_regression/Tests/regress_ogc.sql
b/geom/sql/Tests/pg_regression/Tests/regress_ogc.sql
new file mode 100644
--- /dev/null
+++ b/geom/sql/Tests/pg_regression/Tests/regress_ogc.sql
@@ -0,0 +1,150 @@
+---
+--- Tests for GEOS/JTS implemented functions
+---
+---
+-- Repeat all tests with new function names.
+--SET client_min_messages TO NOTICE;
+SELECT 'buffer', ST_astext(ST_SnapToGrid(ST_buffer('POINT(0 0)', 1, 2),
1.0e-6));
+
+SELECT 'geomunion', ST_astext(ST_union('POINT(0 0)', 'POINT(1 1)'));
+SELECT 'convexhull', ST_asewkt(ST_convexhull('POLYGON((0 0, 10 0, 10 10, 0 10,
0 0),(2 2, 2 4, 4 4, 4 2, 2 2))'));
+SELECT 'relate', ST_relate('POINT(0 0)', 'LINESTRING(0 0, 1 1)');
+SELECT 'relate', ST_relate('POINT(0 0)', 'LINESTRING(0 0, 1 1)', 'F0FFFF*02');
+SELECT 'relate', ST_relate('POINT(0 0)', 'LINESTRING(0 0, 1 1)', 'F0FFF0*02');
+SELECT 'disjoint', ST_disjoint('POINT(0 0)', 'LINESTRING(0 0, 1 1)');
+SELECT 'touches', ST_touches('LINESTRING(0 10, 0 -10)', 'LINESTRING(0 0, 1
1)');
+SELECT 'intersects', ST_intersects('LINESTRING(0 10, 0 -10)', 'LINESTRING(0 0,
1 1)');
+SELECT 'crosses', ST_crosses('LINESTRING(0 10, 0 -10)', 'LINESTRING(0 0, 1
1)');
+SELECT 'crosses', ST_crosses('LINESTRING(0 10, 0 -10)', 'LINESTRING(-4 0, 1
1)');
+-- PIP - point within polygon
+SELECT 'within100', ST_within('POINT(5 5)', 'POLYGON((0 0, 0 10, 10 10, 10 0,
0 0))');
+-- PIP - point on vertex of polygon
+SELECT 'within101', ST_within('POINT(0 0)', 'POLYGON((0 0, 0 10, 10 10, 10 0,
0 0))');
+-- PIP - point outside polygon
+SELECT 'within102', ST_within('POINT(-1 0)', 'POLYGON((0 0, 0 10, 10 10, 10 0,
0 0))');
+-- PIP - point on edge of polygon
+SELECT 'within103', ST_within('POINT(0 5)', 'POLYGON((0 0, 0 10, 10 10, 10 0,
0 0))');
+-- PIP - point in line with polygon edge
+SELECT 'within104', ST_within('POINT(0 12)', 'POLYGON((0 0, 0 10, 10 10, 10 0,
0 0))');
+-- PIP - point vertically aligned with polygon vertex
+SELECT 'within105', ST_within(ST_GeomFromText('POINT(521513 5377804)', 32631),
ST_GeomFromText('POLYGON((521526 5377783, 521481 5377811, 521494 5377832,
521539 5377804, 521526 5377783))', 32631));
+-- PIP - repeated vertex
+SELECT 'within106', ST_within(ST_GeomFromText('POINT(521513 5377804)', 32631),
ST_GeomFromText('POLYGON((521526 5377783, 521482 5377811, 521481 5377811,
521494 5377832, 521539 5377804, 521526 5377783))', 32631));
+-- PIP - point within polygon
+SELECT 'disjoint100', ST_disjoint('POINT(5 5)', 'POLYGON((0 0, 0 10, 10 10, 10
0, 0 0))');
+-- PIP - point on polygon vertex
+SELECT 'disjoint101', ST_disjoint('POINT(0 0)', 'POLYGON((0 0, 0 10, 10 10, 10
0, 0 0))');
+-- PIP - point outside polygon
+SELECT 'disjoint102', ST_disjoint('POINT(-1 0)', 'POLYGON((0 0, 0 10, 10 10,
10 0, 0 0))');
+-- PIP - point on polygon edge
+SELECT 'disjoint103', ST_disjoint('POINT(0 5)', 'POLYGON((0 0, 0 10, 10 10, 10
0, 0 0))');
+-- PIP - point in line with polygon edge
+SELECT 'disjoint104', ST_disjoint('POINT(0 12)', 'POLYGON((0 0, 0 10, 10 10,
10 0, 0 0))');
+-- PIP - point vertically aligned with polygon vertex
+SELECT 'disjoint105', ST_disjoint(ST_GeomFromText('POINT(521513 5377804)',
32631), ST_GeomFromText('POLYGON((521526 5377783, 521481 5377811, 521494
5377832, 521539 5377804, 521526 5377783))', 32631));
+-- PIP - repeated vertex
+SELECT 'disjoint106', ST_disjoint(ST_GeomFromText('POINT(521543 5377804)',
32631), ST_GeomFromText('POLYGON((521526 5377783, 521482 5377811, 521494
5377832, 521539 5377804, 521526 5377783))', 32631));
+-- PIP - point within polygon
+SELECT 'disjoint150', ST_disjoint('POINT(5 5)', 'POLYGON((0 0, 0 10, 10 10, 10
0, 0 0))');
+-- PIP - point on polygon vertex
+SELECT 'disjoint151', ST_disjoint('POINT(0 0)', 'POLYGON((0 0, 0 10, 10 10, 10
0, 0 0))');
+-- PIP - point outside polygon
+SELECT 'disjoint152', ST_disjoint('POINT(-1 0)', 'POLYGON((0 0, 0 10, 10 10,
10 0, 0 0))');
+-- PIP - point on polygon edge
+SELECT 'disjoint153', ST_disjoint('POINT(0 5)', 'POLYGON((0 0, 0 10, 10 10, 10
0, 0 0))');
+-- PIP - point in line with polygon edge
+SELECT 'disjoint154', ST_disjoint('POINT(0 12)', 'POLYGON((0 0, 0 10, 10 10,
10 0, 0 0))');
+-- PIP - point vertically aligned with polygon vertex
+SELECT 'disjoint155', ST_disjoint(ST_GeomFromText('POINT(521513 5377804)',
32631), ST_GeomFromText('POLYGON((521526 5377783, 521481 5377811, 521494
5377832, 521539 5377804, 521526 5377783))', 32631));
+-- PIP - repeated vertex
+SELECT 'disjoint156', ST_disjoint(ST_GeomFromText('POINT(521543 5377804)',
32631), ST_GeomFromText('POLYGON((521526 5377783, 521482 5377811, 521494
5377832, 521539 5377804, 521526 5377783))', 32631));
+-- PIP - point within polygon
+SELECT 'intersects100', ST_intersects('POINT(5 5)', 'POLYGON((0 0, 0 10, 10
10, 10 0, 0 0))');
+-- PIP - point on polygon vertex
+SELECT 'intersects101', ST_intersects('POINT(0 0)', 'POLYGON((0 0, 0 10, 10
10, 10 0, 0 0))');
+-- PIP - point outside polygon
+SELECT 'intersects102', ST_intersects('POINT(-1 0)', 'POLYGON((0 0, 0 10, 10
10, 10 0, 0 0))');
+-- PIP - point on polygon edge
+SELECT 'intersects103', ST_intersects('POINT(0 5)', 'POLYGON((0 0, 0 10, 10
10, 10 0, 0 0))');
+-- PIP - point in line with polygon edge
+SELECT 'intersects104', ST_intersects('POINT(0 12)', 'POLYGON((0 0, 0 10, 10
10, 10 0, 0 0))');
+-- PIP - point vertically aligned with polygon vertex
+SELECT 'intersects105', ST_intersects(ST_GeomFromText('POINT(521513 5377804)',
32631), ST_GeomFromText('POLYGON((521526 5377783, 521481 5377811, 521494
5377832, 521539 5377804, 521526 5377783))', 32631));
+-- PIP - repeated vertex
+SELECT 'intersects106', ST_intersects(ST_GeomFromText('POINT(521543 5377804)',
32631), ST_GeomFromText('POLYGON((521526 5377783, 521482 5377811, 521494
5377832, 521539 5377804, 521526 5377783))', 32631));
+-- PIP - point within polygon
+SELECT 'intersects150', ST_intersects('POINT(5 5)', 'POLYGON((0 0, 0 10, 10
10, 10 0, 0 0))');
+-- PIP - point on polygon vertex
+SELECT 'intersects151', ST_intersects('POINT(0 0)', 'POLYGON((0 0, 0 10, 10
10, 10 0, 0 0))');
+-- PIP - point outside polygon
+SELECT 'intersects152', ST_intersects('POINT(-1 0)', 'POLYGON((0 0, 0 10, 10
10, 10 0, 0 0))');
+-- PIP - point on polygon edge
+SELECT 'intersects153', ST_intersects('POINT(0 5)', 'POLYGON((0 0, 0 10, 10
10, 10 0, 0 0))');
+-- PIP - point in line with polygon edge
+SELECT 'intersects154', ST_intersects('POINT(0 12)', 'POLYGON((0 0, 0 10, 10
10, 10 0, 0 0))');
+-- PIP - point vertically aligned with polygon vertex
+SELECT 'intersects155', ST_intersects(ST_GeomFromText('POINT(521513 5377804)',
32631), ST_GeomFromText('POLYGON((521526 5377783, 521481 5377811, 521494
5377832, 521539 5377804, 521526 5377783))', 32631));
+-- PIP - repeated vertex
+SELECT 'intersects156', ST_intersects(ST_GeomFromText('POINT(521543 5377804)',
32631), ST_GeomFromText('POLYGON((521526 5377783, 521482 5377811, 521494
5377832, 521539 5377804, 521526 5377783))', 32631));
+-- PIP - point within polygon
+SELECT 'contains100', ST_contains('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'POINT(5 5)');
+-- PIP - point on vertex of polygon
+SELECT 'contains101', ST_contains('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'POINT(0 0)');
+-- PIP - point outside polygon
+SELECT 'contains102', ST_contains('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'POINT(-1 0)');
+-- PIP - point on edge of polygon
+SELECT 'contains103', ST_contains('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'POINT(0 5)');
+-- PIP - point in line with polygon edge
+SELECT 'contains104', ST_contains('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'POINT(0 12)');
+-- PIP - point vertically aligned with polygon vertex
+SELECT 'contains105', ST_contains(ST_GeomFromText('POLYGON((521526 5377783,
521481 5377811, 521494 5377832, 521539 5377804, 521526 5377783))', 32631),
ST_GeomFromText('POINT(521513 5377804)', 32631));
+-- PIP - repeated vertex
+SELECT 'contains106', ST_contains(ST_GeomFromText('POLYGON((521526 5377783,
521482 5377811, 521481 5377811, 521494 5377832, 521539 5377804, 521526
5377783))', 32631), ST_GeomFromText('POINT(521513 5377804)', 32631));
+-- moved here from regress.sql
+select 'within119', ST_within('LINESTRING(-1 -1, -1 101, 101 101, 101
-1)','BOX3D(0 0, 100 100)');
+select 'within120', ST_within('LINESTRING(-1 -1, -1 100, 101 100, 101
-1)','BOX3D(0 0, 100 100)');
+SELECT 'contains110', ST_Contains('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'LINESTRING(1 10, 9 10, 9 8)');
+SELECT 'contains111', ST_Contains('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'LINESTRING(1 10, 10 10, 10 8)');
+SELECT 'within130', ST_Within('LINESTRING(1 10, 9 10, 9 8)', 'POLYGON((0 0, 0
10, 10 10, 10 0, 0 0))');
+SELECT 'within131', ST_Within('LINESTRING(1 10, 10 10, 10 8)', 'POLYGON((0 0,
0 10, 10 10, 10 0, 0 0))');
+SELECT 'overlaps', ST_overlaps('POLYGON((0 0, 0 10, 10 10, 10 0, 0
0))','POINT(5 5)');
+SELECT 'isvalid', ST_isvalid('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))');
+SELECT 'isvalid', ST_isvalid('POLYGON((0 0, 0 10, 10 10, -5 10, 10 0, 0 0))');
+SELECT 'isvalid', ST_isvalid('GEOMETRYCOLLECTION EMPTY');
+SELECT 'intersection', ST_astext(ST_intersection('LINESTRING(0 10, 0 -10)',
'LINESTRING(0 0, 1 1)'));
+SELECT 'difference', ST_astext(ST_difference('LINESTRING(0 10, 0 -10)',
'LINESTRING(0 2, 0 -2)'));
+SELECT 'boundary', ST_astext(ST_boundary('POLYGON((0 0, 0 10, 10 10, 10 0, 0
0),(2 2, 2 4, 4 4, 4 2, 2 2))'));
+SELECT 'symdifference', ST_astext(ST_symdifference('POLYGON((0 0, 0 10, 10 10,
10 0, 0 0),(2 2, 2 4, 4 4, 4 2, 2 2))', 'LINESTRING(0 0, 20 20)'));
+SELECT 'issimple', ST_issimple('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0),(2 2, 2
4, 4 4, 4 2, 2 2))');
+SELECT 'equals', ST_equals('LINESTRING(0 0, 1 1)', 'LINESTRING(1 1, 0 0)');
+WITH inp AS ( SELECT
+ 'POLYGON((0 0, 0 10, 10 10, 10 0, 0 0),(2 2, 2 4, 4 4, 4 2, 2 2))' as g )
+SELECT 'pointonsurface', ST_Contains(g, ST_pointonsurface(g)) from inp;
+SELECT 'centroid', ST_astext(ST_centroid('POLYGON((0 0, 0 10, 10 10, 10 0, 0
0),(2 2, 2 4, 4 4, 4 2, 2 2))'));
+SELECT 'exteriorring',
ST_astext(ST_exteriorring(ST_PolygonFromText('POLYGON((52 18,66 23,73 9,48 6,52
18),(59 18,67 18,67 13,59 13,59 18))')));
+SELECT 'polygonize_garray',
ST_astext(ST_polygonize('{0102000000020000000000000000000000000000000000000000000000000024400000000000000000:0102000000020000000000000000002440000000000000000000000000000000000000000000000000:0102000000020000000000000000002440000000000000244000000000000000000000000000000000:0102000000020000000000000000002440000000000000244000000000000024400000000000000000:0102000000020000000000000000002440000000000000244000000000000000000000000000002440:0102000000020000000000000000000000000000000000244000000000000000000000000000002440:0102000000020000000000000000000000000000000000244000000000000024400000000000002440:0102000000020000000000000000000000000000000000244000000000000000000000000000000000:0102000000020000000000000000000000000000000000244000000000000024400000000000000000}'));
+
+SELECT 'polygonize_garray',
ST_astext(ST_geometryn(ST_polygonize('{LINESTRING(0 0, 10 0):LINESTRING(10 0,
10 10):LINESTRING(10 10, 0 10):LINESTRING(0 10, 0 0)}'), 1));
+
+select 'linemerge149', ST_asewkt(ST_linemerge('GEOMETRYCOLLECTION(LINESTRING(0
0, 1 1), LINESTRING(4 4, 1 1), LINESTRING(-5 -5, 0 0))'));
+
+--- postgis-devel/2005-December/001784.html
+select 'intersects', ST_intersects(
+ ST_polygonfromtext('POLYGON((0.0 0.0,1.0 0.0,1.0 1.0,1.0 0.0,0.0 0.0))'),
+ ST_polygonfromtext('POLYGON((0.0 2.0,1.0 2.0,1.0 3.0,0.0 3.0,0.0 2.0))')
+ );
+
+select 'ST_GeometryN', ST_asewkt(ST_GeometryN('LINESTRING(0 0, 1 1)', 1));
+select 'ST_NumGeometries', ST_NumGeometries(ST_GeomFromText('LINESTRING(0 0, 1
1)'));
+select 'ST_Union1', ST_AsText(ST_Union('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))',
'POLYGON((0.5 0.5, 1.5 0.5, 1.5 1.5, 0.5 1.5, 0.5 0.5))'));
+select 'ST_StartPoint1',ST_AsText(ST_StartPoint('LINESTRING(0 0, 1 1, 2 2)'));
+select 'ST_EndPoint1', ST_AsText(ST_Endpoint('LINESTRING(0 0, 1 1, 2 2)'));
+select 'ST_PointN1', ST_AsText(ST_PointN('LINESTRING(0 0, 1 1, 2 2)',2));
+select 'ST_PointN2', ST_AsText(ST_PointN('LINESTRING(0 0, 1 1, 2 2)',3));
+select 'ST_PointN3', ST_AsText(ST_PointN('LINESTRING(0 0, 1 1, 2 2)',4));
+select 'ST_PointN4', ST_AsText(ST_PointN('LINESTRING(0 0, 1 1, 2 2)',0));
+select 'ST_PointN5', ST_AsText(ST_PointN('LINESTRING(0 0, 1 1, 2 2)',1));
+select 'ST_PointN6', ST_AsText(ST_PointN('POLYGON((0 0, 1 1, 0 1, 0 0))',1));
+
+-- issues with EMPTY --
+select 'ST_Buffer(empty)', ST_AsText(ST_Buffer('POLYGON EMPTY', 0.5));
diff --git a/geom/sql/Tests/pg_regression/Tests/regress_ogc_cover.sql
b/geom/sql/Tests/pg_regression/Tests/regress_ogc_cover.sql
new file mode 100755
--- /dev/null
+++ b/geom/sql/Tests/pg_regression/Tests/regress_ogc_cover.sql
@@ -0,0 +1,39 @@
+---
+--- Tests for GEOS/JTS implemented functions
+--- supported by GEOS 3.0 and upwards
+---
+
+SELECT 'covers100', ST_Covers('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'LINESTRING(1 10, 9 10, 9 8)');
+SELECT 'covers101', ST_Covers('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'LINESTRING(1 10, 10 10, 10 8)');
+-- PIP - point within polygon
+SELECT 'covers102', ST_Covers('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'POINT(5 5)');
+-- PIP - point on vertex of polygon
+SELECT 'covers103', ST_Covers('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'POINT(0 0)');
+-- PIP - point outside polygon
+SELECT 'covers104', ST_Covers('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'POINT(-1 0)');
+-- PIP - point on edge of polygon
+SELECT 'covers105', ST_Covers('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'POINT(0 5)');
+-- PIP - point in line with polygon edge
+SELECT 'covers106', ST_Covers('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'POINT(0 12)');
+-- PIP - point vertically aligned with polygon vertex
+SELECT 'covers107', ST_Covers(ST_GeomFromText('POLYGON((521526 5377783, 521481
5377811, 521494 5377832, 521539 5377804, 521526 5377783))', 32631),
ST_GeomFromText('POINT(521513 5377804)', 32631));
+-- PIP - repeated vertex
+SELECT 'covers108', ST_Covers(ST_GeomFromText('POLYGON((521526 5377783, 521482
5377811, 521481 5377811, 521494 5377832, 521539 5377804, 521526 5377783))',
32631), ST_GeomFromText('POINT(521513 5377804)', 32631));
+-- CoveredBy cases
+SELECT 'coveredby100', ST_CoveredBy('LINESTRING(1 10, 9 10, 9 8)', 'POLYGON((0
0, 0 10, 10 10, 10 0, 0 0))');
+SELECT 'coveredby101', ST_CoveredBy('LINESTRING(1 10, 10 10, 10 8)',
'POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))');
+-- PIP - point within polygon
+SELECT 'coveredby102', ST_CoveredBy('POINT(5 5)', 'POLYGON((0 0, 0 10, 10 10,
10 0, 0 0))');
+-- PIP - point on vertex of polygon
+SELECT 'coveredby103', ST_CoveredBy('POINT(0 0)', 'POLYGON((0 0, 0 10, 10 10,
10 0, 0 0))');
+-- PIP - point outside polygon
+SELECT 'coveredby104', ST_CoveredBy('POINT(-1 0)', 'POLYGON((0 0, 0 10, 10 10,
10 0, 0 0))');
+-- PIP - point on edge of polygon
+SELECT 'coveredby105', ST_CoveredBy('POINT(0 5)', 'POLYGON((0 0, 0 10, 10 10,
10 0, 0 0))');
+-- PIP - point in line with polygon edge
+SELECT 'coveredby106', ST_CoveredBy('POINT(0 12)', 'POLYGON((0 0, 0 10, 10 10,
10 0, 0 0))');
+-- PIP - point vertically aligned with polygon vertex
+SELECT 'coveredby107', ST_CoveredBy(ST_GeomFromText('POINT(521513 5377804)',
32631), ST_GeomFromText('POLYGON((521526 5377783, 521481 5377811, 521494
5377832, 521539 5377804, 521526 5377783))', 32631));
+-- PIP - repeated vertex
+SELECT 'coveredby108', ST_CoveredBy(ST_GeomFromText('POINT(521513 5377804)',
32631), ST_GeomFromText('POLYGON((521526 5377783, 521482 5377811, 521481
5377811, 521494 5377832, 521539 5377804, 521526 5377783))', 32631));
+
diff --git a/geom/sql/Tests/pg_regression/Tests/regress_ogc_cover.stable.err
b/geom/sql/Tests/pg_regression/Tests/regress_ogc_cover.stable.err
new file mode 100644
--- /dev/null
+++ b/geom/sql/Tests/pg_regression/Tests/regress_ogc_cover.stable.err
@@ -0,0 +1,36 @@
+stderr of test 'regress_ogc_cover` in directory 'geom/sql/Tests/pg_regression`
itself:
+
+
+# 17:00:01 >
+# 17:00:01 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"mapi_open=true" "--set" "mapi_port=37341" "--set"
"mapi_usock=/var/tmp/mtest-15092/.s.monetdb.37341" "--set" "monet_prompt="
"--forcemito" "--set" "mal_listing=2"
"--dbpath=/export/scratch1/alvanaki/INSTALL/MonetDB-public/var/MonetDB/mTests_geom_sql_Tests_pg_regression"
"--set" "mal_listing=0"
+# 17:00:01 >
+
+# builtin opt gdk_dbpath =
/export/scratch1/alvanaki/INSTALL/MonetDB-public/var/monetdb5/dbfarm/demo
+# builtin opt gdk_debug = 0
+# builtin opt gdk_vmtrim = no
+# builtin opt monet_prompt = >
+# builtin opt monet_daemon = no
+# builtin opt mapi_port = 50000
+# builtin opt mapi_open = false
+# builtin opt mapi_autosense = false
+# builtin opt sql_optimizer = default_pipe
+# builtin opt sql_debug = 0
+# cmdline opt gdk_nr_threads = 0
+# cmdline opt mapi_open = true
+# cmdline opt mapi_port = 37341
+# cmdline opt mapi_usock = /var/tmp/mtest-15092/.s.monetdb.37341
+# cmdline opt monet_prompt =
+# cmdline opt mal_listing = 2
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list