Mercurial > gemma
comparison schema/tap_tests_data.sql @ 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 | 79f4a20e31c2 |
children | a2127495093e |
comparison
equal
deleted
inserted
replaced
2687:3b98de34de90 | 2688:d316a6e41f54 |
---|---|
86 ST_SetSRID(ST_CurveToLine( | 86 ST_SetSRID(ST_CurveToLine( |
87 'CIRCULARSTRING(0 0, 0.5 0.5, 0.6 0.4)'), | 87 'CIRCULARSTRING(0 0, 0.5 0.5, 0.6 0.4)'), |
88 4326), | 88 4326), |
89 'testriver' | 89 'testriver' |
90 ), ( | 90 ), ( |
91 ST_SetSRID(ST_CurveToLine('CIRCULARSTRING(0.6 0.4, 1 0, 1.5 0)'), 4326), | 91 ST_SetSRID(ST_CurveToLine('CIRCULARSTRING(0.6 0.4, 1 0, 1.5 -0.00001)'), |
92 4326), | |
92 'testriver' | 93 'testriver' |
93 ), ( | 94 ), ( |
94 ST_SetSRID('LINESTRING(0.5 0.5, 1 1)'::geometry, 4326), | 95 ST_SetSRID('LINESTRING(0.5 0.5, 1 1)'::geometry, 4326), |
95 'testriver' | 96 'testriver' |
96 ), ( | 97 ), ( |
97 ST_SetSRID('LINESTRING(1.5 0.00001, 2 0)'::geometry, 4326), | 98 ST_SetSRID('LINESTRING(1.5 0, 1.55001 0)'::geometry, 4326), |
99 'testriver' | |
100 ), ( | |
101 ST_SetSRID('LINESTRING(1.55 0, 2 0)'::geometry, 4326), | |
98 'testriver' | 102 'testriver' |
99 ); | 103 ); |
100 | 104 |
101 -- Simulate waterway area as non-intersecting buffers around axis | 105 -- Simulate waterway area as non-intersecting buffers around axis |
102 WITH RECURSIVE | 106 WITH RECURSIVE |
111 ST_Difference(buf, others), | 115 ST_Difference(buf, others), |
112 ST_Union(buf, others) | 116 ST_Union(buf, others) |
113 FROM cleaned, buffer | 117 FROM cleaned, buffer |
114 WHERE id <> ALL(ids) | 118 WHERE id <> ALL(ids) |
115 ORDER BY id ASC, ids DESC | 119 ORDER BY id ASC, ids DESC |
116 FETCH FIRST ROW ONLY)) | 120 FETCH FIRST ROW ONLY)), |
117 INSERT INTO waterway.waterway_area (area) SELECT cbuf FROM cleaned; | 121 cleaned1 AS ( |
122 SELECT geom | |
123 FROM (SELECT (ST_Dump(cbuf)).geom FROM cleaned) AS dmp, | |
124 waterway.waterway_axis | |
125 WHERE ST_Intersects(geom, wtwaxs)) | |
126 INSERT INTO waterway.waterway_area (area) SELECT geom FROM cleaned1; | |
118 | 127 |
119 INSERT INTO users.templates (template_name, country, template_data) | 128 INSERT INTO users.templates (template_name, country, template_data) |
120 VALUES ('AT', 'AT', '\x'), ('RO', 'RO', '\x'); | 129 VALUES ('AT', 'AT', '\x'), ('RO', 'RO', '\x'); |
121 | 130 |
122 WITH | 131 WITH |