Mercurial > gemma
changeset 2688:d316a6e41f54
Test if overlapping axis chunks are sewed together correctly
Currently this is ensured by ST_SimplifyPreserveTopology.
Imprecise buffering results made it necessary to introduce another cleaning
step in the simulation of waterway area for the test data.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 15 Mar 2019 16:35:08 +0100 |
parents | 3b98de34de90 |
children | 8f919fe629f9 |
files | schema/isrs_tests.sql schema/run_tests.sh schema/tap_tests_data.sql |
diffstat | 3 files changed, 21 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/schema/isrs_tests.sql Fri Mar 15 15:59:40 2019 +0100 +++ b/schema/isrs_tests.sql Fri Mar 15 16:35:08 2019 +0100 @@ -52,6 +52,13 @@ 'ISRSrange_axis fails if no contiguous axis can be constructed'); SELECT ok( + ST_IsSimple(ISRSrange_axis(isrsrange( + ('AT', 'XXX', '00001', '00000', 0)::isrs, + ('AT', 'XXX', '00001', '00000', 2)::isrs), + 5)), + 'ISRSrange_axis returns a valid simple feature'); + +SELECT ok( ISRSrange_area(ISRSrange_axis(isrsrange( ('AT', 'XXX', '00001', '00000', 0)::isrs, ('AT', 'XXX', '00001', '00000', 1)::isrs),
--- a/schema/run_tests.sh Fri Mar 15 15:59:40 2019 +0100 +++ b/schema/run_tests.sh Fri Mar 15 16:35:08 2019 +0100 @@ -28,7 +28,7 @@ -c 'SET client_min_messages TO WARNING' \ -c "DROP ROLE IF EXISTS $TEST_ROLES" \ -f tap_tests_data.sql \ - -c 'SELECT plan(60)' \ + -c 'SELECT plan(61)' \ -f isrs_tests.sql \ -f auth_tests.sql \ -f manage_users_tests.sql \
--- a/schema/tap_tests_data.sql Fri Mar 15 15:59:40 2019 +0100 +++ b/schema/tap_tests_data.sql Fri Mar 15 16:35:08 2019 +0100 @@ -88,13 +88,17 @@ 4326), 'testriver' ), ( - ST_SetSRID(ST_CurveToLine('CIRCULARSTRING(0.6 0.4, 1 0, 1.5 0)'), 4326), + ST_SetSRID(ST_CurveToLine('CIRCULARSTRING(0.6 0.4, 1 0, 1.5 -0.00001)'), + 4326), 'testriver' ), ( ST_SetSRID('LINESTRING(0.5 0.5, 1 1)'::geometry, 4326), 'testriver' ), ( - ST_SetSRID('LINESTRING(1.5 0.00001, 2 0)'::geometry, 4326), + ST_SetSRID('LINESTRING(1.5 0, 1.55001 0)'::geometry, 4326), + 'testriver' +), ( + ST_SetSRID('LINESTRING(1.55 0, 2 0)'::geometry, 4326), 'testriver' ); @@ -113,8 +117,13 @@ FROM cleaned, buffer WHERE id <> ALL(ids) ORDER BY id ASC, ids DESC - FETCH FIRST ROW ONLY)) -INSERT INTO waterway.waterway_area (area) SELECT cbuf FROM cleaned; + FETCH FIRST ROW ONLY)), +cleaned1 AS ( + SELECT geom + FROM (SELECT (ST_Dump(cbuf)).geom FROM cleaned) AS dmp, + waterway.waterway_axis + WHERE ST_Intersects(geom, wtwaxs)) +INSERT INTO waterway.waterway_area (area) SELECT geom FROM cleaned1; INSERT INTO users.templates (template_name, country, template_data) VALUES ('AT', 'AT', '\x'), ('RO', 'RO', '\x');