[postgis-tickets] r16932 - Fix SFCGAL tests
Sandro Santilli
strk at kbt.io
Sun Oct 21 03:19:25 PDT 2018
Author: strk
Date: 2018-10-21 03:19:25 -0700 (Sun, 21 Oct 2018)
New Revision: 16932
Added:
trunk/regress/sfcgal/regress_sfcgal.sql
trunk/regress/sfcgal/regress_sfcgal_expected
Removed:
trunk/regress/core/regress_sfcgal.sql
trunk/regress/core/regress_sfcgal_expected
Modified:
trunk/regress/sfcgal/Makefile.in
trunk/regress/sfcgal/concave_hull.sql
trunk/regress/sfcgal/legacy.sql
trunk/regress/sfcgal/regress.sql
trunk/regress/sfcgal/regress_ogc.sql
Log:
Fix SFCGAL tests
Deleted: trunk/regress/core/regress_sfcgal.sql
===================================================================
--- trunk/regress/core/regress_sfcgal.sql 2018-10-21 09:59:48 UTC (rev 16931)
+++ trunk/regress/core/regress_sfcgal.sql 2018-10-21 10:19:25 UTC (rev 16932)
@@ -1,41 +0,0 @@
----
---- Regression tests for PostGIS SFCGAL backend
----
-
--- We only care about testing PostGIS prototype here
--- Behaviour is already handled by SFCGAL own tests
-
-SELECT 'postgis_sfcgal_version', count(*) FROM (SELECT postgis_sfcgal_version()) AS f;
-SELECT 'ST_Tesselate', ST_AsText(ST_Tesselate('GEOMETRYCOLLECTION(POINT(4 4),POLYGON((0 0,1 0,1 1,0 1,0 0)))'));
-SELECT 'ST_3DArea', ST_3DArea('POLYGON((0 0 0,1 0 0,1 1 0,0 1 0,0 0 0))');
-SELECT 'ST_Extrude_point', ST_AsText(ST_Extrude('POINT(0 0)', 1, 0, 0));
-SELECT 'ST_Extrude_line', ST_AsText(ST_Extrude(ST_Extrude('POINT(0 0)', 1, 0, 0), 0, 1, 0));
--- In the first SFCGAL versions, the extruded face was wrongly oriented
--- we change the extrusion result to match the original
-SELECT 'ST_Extrude_surface',
-CASE WHEN postgis_sfcgal_version() = '1.0'
-THEN
- ST_AsText(ST_Extrude(ST_Extrude(ST_Extrude('POINT(0 0)', 1, 0, 0), 0, 1, 0), 0, 0, 1))
-ELSE
- regexp_replace(
- regexp_replace(
- ST_AsText(ST_Extrude(ST_Extrude(ST_Extrude('POINT(0 0)', 1, 0, 0), 0, 1, 0), 0, 0, 1)) ,
- '\(\(0 1 0,1 1 0,1 0 0,0 1 0\)\)', '((1 1 0,1 0 0,0 1 0,1 1 0))'),
- '\(\(0 1 0,1 0 0,0 0 0,0 1 0\)\)', '((1 0 0,0 0 0,0 1 0,1 0 0))')
-END;
-
-SELECT 'ST_ForceLHR', ST_AsText(ST_ForceLHR('POLYGON((0 0,0 1,1 1,1 0,0 0))'));
-SELECT 'ST_Orientation_1', ST_Orientation(ST_ForceLHR('POLYGON((0 0,0 1,1 1,1 0,0 0))'));
-SELECT 'ST_Orientation_2', ST_Orientation(ST_ForceRHR('POLYGON((0 0,0 1,1 1,1 0,0 0))'));
-SELECT 'ST_MinkowskiSum', ST_AsText(ST_MinkowskiSum('LINESTRING(0 0,4 0)','POLYGON((0 0,1 0,1 1,0 1,0 0))'));
-SELECT 'ST_StraightSkeleton', ST_AsText(ST_StraightSkeleton('POLYGON((1 1,2 1,2 2,1 2,1 1))'));
-
--- Backend switch tests
-SET postgis.backend = 'geos';
-SELECT 'intersection_geos', ST_astext(ST_intersection('LINESTRING(0 10, 0 -10)', 'LINESTRING(0 0, 1 1)'));
-
-SET postgis.backend = 'sfcgal';
-SELECT 'intersection_sfcgal', ST_astext(ST_intersection('LINESTRING(0 10, 0 -10)', 'LINESTRING(0 0, 1 1)'));
-
-SET postgis.backend = 'foo';
-SET postgis.backend = '';
Deleted: trunk/regress/core/regress_sfcgal_expected
===================================================================
--- trunk/regress/core/regress_sfcgal_expected 2018-10-21 09:59:48 UTC (rev 16931)
+++ trunk/regress/core/regress_sfcgal_expected 2018-10-21 10:19:25 UTC (rev 16932)
@@ -1,15 +0,0 @@
-postgis_sfcgal_version|1
-ST_Tesselate|GEOMETRYCOLLECTION(POINT(4 4),TIN(((0 1,1 0,1 1,0 1)),((0 1,0 0,1 0,0 1))))
-ST_3DArea|1
-ST_Extrude_point|LINESTRING Z (0 0 0,1 0 0)
-ST_Extrude_line|POLYHEDRALSURFACE Z (((0 0 0,1 0 0,1 1 0,0 1 0,0 0 0)))
-ST_Extrude_surface|POLYHEDRALSURFACE Z (((1 1 0,1 0 0,0 1 0,1 1 0)),((0 1 1,1 0 1,1 1 1,0 1 1)),((1 0 0,0 0 0,0 1 0,1 0 0)),((0 1 1,0 0 1,1 0 1,0 1 1)),((1 0 0,1 1 0,1 1 1,1 0 1,1 0 0)),((1 1 0,0 1 0,0 1 1,1 1 1,1 1 0)),((0 1 0,0 0 0,0 0 1,0 1 1,0 1 0)),((0 0 0,1 0 0,1 0 1,0 0 1,0 0 0)))
-ST_ForceLHR|POLYGON((0 0,1 0,1 1,0 1,0 0))
-ST_Orientation_1|-1
-ST_Orientation_2|1
-ST_MinkowskiSum|MULTIPOLYGON(((0 0,1 0,5 0,5 1,4 1,0 1,0 0)))
-ST_StraightSkeleton|MULTILINESTRING((1 1,1.5 1.5),(2 1,1.5 1.5),(2 2,1.5 1.5),(1 2,1.5 1.5))
-intersection_geos|POINT(0 0)
-intersection_sfcgal|POINT(0 0)
-ERROR: Can't find foo geometry backend
-ERROR: Can't find geometry backend
Modified: trunk/regress/sfcgal/Makefile.in
===================================================================
--- trunk/regress/sfcgal/Makefile.in 2018-10-21 09:59:48 UTC (rev 16931)
+++ trunk/regress/sfcgal/Makefile.in 2018-10-21 10:19:25 UTC (rev 16932)
@@ -36,17 +36,17 @@
# SFCGAL additionnal backend
TESTS += \
regress_sfcgal \
- sfcgal/empty.sql \
- sfcgal/geography.sql \
- sfcgal/legacy.sql \
- sfcgal/measures.sql \
- sfcgal/regress_ogc_prep.sql \
- sfcgal/regress_ogc.sql \
- sfcgal/regress.sql \
- sfcgal/tickets.sql \
- sfcgal/concave_hull.sql \
- sfcgal/wmsservers.sql \
- sfcgal/approximatemedialaxis.sql
+ empty.sql \
+ geography.sql \
+ legacy.sql \
+ measures.sql \
+ regress_ogc_prep.sql \
+ regress_ogc.sql \
+ regress.sql \
+ tickets.sql \
+ concave_hull.sql \
+ wmsservers.sql \
+ approximatemedialaxis.sql
SFCGALTESTFLAGS = --sfcgal
endif
Modified: trunk/regress/sfcgal/concave_hull.sql
===================================================================
--- trunk/regress/sfcgal/concave_hull.sql 2018-10-21 09:59:48 UTC (rev 16931)
+++ trunk/regress/sfcgal/concave_hull.sql 2018-10-21 10:19:25 UTC (rev 16932)
@@ -1,9 +1,9 @@
----
---- SFCGAL backend tests based on GEOS/JTS implemented functions
----
----
-
-SET postgis.backend = 'sfcgal';
-
-\cd :regdir
-\i concave_hull.sql
\ No newline at end of file
+---
+--- SFCGAL backend tests based on GEOS/JTS implemented functions
+---
+---
+
+SET postgis.backend = 'sfcgal';
+
+\cd :regdir
+\i core/concave_hull.sql
Modified: trunk/regress/sfcgal/legacy.sql
===================================================================
--- trunk/regress/sfcgal/legacy.sql 2018-10-21 09:59:48 UTC (rev 16931)
+++ trunk/regress/sfcgal/legacy.sql 2018-10-21 10:19:25 UTC (rev 16932)
@@ -9,4 +9,4 @@
SET postgis.backend = 'sfcgal';
\cd :regdir
-\i legacy.sql
+\i core/legacy.sql
Modified: trunk/regress/sfcgal/regress.sql
===================================================================
--- trunk/regress/sfcgal/regress.sql 2018-10-21 09:59:48 UTC (rev 16931)
+++ trunk/regress/sfcgal/regress.sql 2018-10-21 10:19:25 UTC (rev 16932)
@@ -191,7 +191,7 @@
-- create a table with data that will be TOASTed (even after compression)
create table TEST(a GEOMETRY, b GEOMETRY);
-\i regress_biginsert.sql
+\i :regdir/core/regress_biginsert.sql
---test basic ops on this
Modified: trunk/regress/sfcgal/regress_ogc.sql
===================================================================
--- trunk/regress/sfcgal/regress_ogc.sql 2018-10-21 09:59:48 UTC (rev 16931)
+++ trunk/regress/sfcgal/regress_ogc.sql 2018-10-21 10:19:25 UTC (rev 16932)
@@ -6,4 +6,4 @@
SET postgis.backend = 'sfcgal';
\cd :regdir
-\i regress_ogc.sql
+\i core/regress_ogc.sql
Copied: trunk/regress/sfcgal/regress_sfcgal.sql (from rev 16931, trunk/regress/core/regress_sfcgal.sql)
===================================================================
--- trunk/regress/sfcgal/regress_sfcgal.sql (rev 0)
+++ trunk/regress/sfcgal/regress_sfcgal.sql 2018-10-21 10:19:25 UTC (rev 16932)
@@ -0,0 +1,41 @@
+---
+--- Regression tests for PostGIS SFCGAL backend
+---
+
+-- We only care about testing PostGIS prototype here
+-- Behaviour is already handled by SFCGAL own tests
+
+SELECT 'postgis_sfcgal_version', count(*) FROM (SELECT postgis_sfcgal_version()) AS f;
+SELECT 'ST_Tesselate', ST_AsText(ST_Tesselate('GEOMETRYCOLLECTION(POINT(4 4),POLYGON((0 0,1 0,1 1,0 1,0 0)))'));
+SELECT 'ST_3DArea', ST_3DArea('POLYGON((0 0 0,1 0 0,1 1 0,0 1 0,0 0 0))');
+SELECT 'ST_Extrude_point', ST_AsText(ST_Extrude('POINT(0 0)', 1, 0, 0));
+SELECT 'ST_Extrude_line', ST_AsText(ST_Extrude(ST_Extrude('POINT(0 0)', 1, 0, 0), 0, 1, 0));
+-- In the first SFCGAL versions, the extruded face was wrongly oriented
+-- we change the extrusion result to match the original
+SELECT 'ST_Extrude_surface',
+CASE WHEN postgis_sfcgal_version() = '1.0'
+THEN
+ ST_AsText(ST_Extrude(ST_Extrude(ST_Extrude('POINT(0 0)', 1, 0, 0), 0, 1, 0), 0, 0, 1))
+ELSE
+ regexp_replace(
+ regexp_replace(
+ ST_AsText(ST_Extrude(ST_Extrude(ST_Extrude('POINT(0 0)', 1, 0, 0), 0, 1, 0), 0, 0, 1)) ,
+ '\(\(0 1 0,1 1 0,1 0 0,0 1 0\)\)', '((1 1 0,1 0 0,0 1 0,1 1 0))'),
+ '\(\(0 1 0,1 0 0,0 0 0,0 1 0\)\)', '((1 0 0,0 0 0,0 1 0,1 0 0))')
+END;
+
+SELECT 'ST_ForceLHR', ST_AsText(ST_ForceLHR('POLYGON((0 0,0 1,1 1,1 0,0 0))'));
+SELECT 'ST_Orientation_1', ST_Orientation(ST_ForceLHR('POLYGON((0 0,0 1,1 1,1 0,0 0))'));
+SELECT 'ST_Orientation_2', ST_Orientation(ST_ForceRHR('POLYGON((0 0,0 1,1 1,1 0,0 0))'));
+SELECT 'ST_MinkowskiSum', ST_AsText(ST_MinkowskiSum('LINESTRING(0 0,4 0)','POLYGON((0 0,1 0,1 1,0 1,0 0))'));
+SELECT 'ST_StraightSkeleton', ST_AsText(ST_StraightSkeleton('POLYGON((1 1,2 1,2 2,1 2,1 1))'));
+
+-- Backend switch tests
+SET postgis.backend = 'geos';
+SELECT 'intersection_geos', ST_astext(ST_intersection('LINESTRING(0 10, 0 -10)', 'LINESTRING(0 0, 1 1)'));
+
+SET postgis.backend = 'sfcgal';
+SELECT 'intersection_sfcgal', ST_astext(ST_intersection('LINESTRING(0 10, 0 -10)', 'LINESTRING(0 0, 1 1)'));
+
+SET postgis.backend = 'foo';
+SET postgis.backend = '';
Copied: trunk/regress/sfcgal/regress_sfcgal_expected (from rev 16931, trunk/regress/core/regress_sfcgal_expected)
===================================================================
--- trunk/regress/sfcgal/regress_sfcgal_expected (rev 0)
+++ trunk/regress/sfcgal/regress_sfcgal_expected 2018-10-21 10:19:25 UTC (rev 16932)
@@ -0,0 +1,15 @@
+postgis_sfcgal_version|1
+ST_Tesselate|GEOMETRYCOLLECTION(POINT(4 4),TIN(((0 1,1 0,1 1,0 1)),((0 1,0 0,1 0,0 1))))
+ST_3DArea|1
+ST_Extrude_point|LINESTRING Z (0 0 0,1 0 0)
+ST_Extrude_line|POLYHEDRALSURFACE Z (((0 0 0,1 0 0,1 1 0,0 1 0,0 0 0)))
+ST_Extrude_surface|POLYHEDRALSURFACE Z (((1 1 0,1 0 0,0 1 0,1 1 0)),((0 1 1,1 0 1,1 1 1,0 1 1)),((1 0 0,0 0 0,0 1 0,1 0 0)),((0 1 1,0 0 1,1 0 1,0 1 1)),((1 0 0,1 1 0,1 1 1,1 0 1,1 0 0)),((1 1 0,0 1 0,0 1 1,1 1 1,1 1 0)),((0 1 0,0 0 0,0 0 1,0 1 1,0 1 0)),((0 0 0,1 0 0,1 0 1,0 0 1,0 0 0)))
+ST_ForceLHR|POLYGON((0 0,1 0,1 1,0 1,0 0))
+ST_Orientation_1|-1
+ST_Orientation_2|1
+ST_MinkowskiSum|MULTIPOLYGON(((0 0,1 0,5 0,5 1,4 1,0 1,0 0)))
+ST_StraightSkeleton|MULTILINESTRING((1 1,1.5 1.5),(2 1,1.5 1.5),(2 2,1.5 1.5),(1 2,1.5 1.5))
+intersection_geos|POINT(0 0)
+intersection_sfcgal|POINT(0 0)
+ERROR: Can't find foo geometry backend
+ERROR: Can't find geometry backend
More information about the postgis-tickets
mailing list