Mercurial > gemma
annotate schema/gemma_tests.sql @ 2781:a2127495093e
Prevent duplicate waterway axis and area geometries
Duplicate axis geometries can prevent finding a contiguous axis
between two distance marks in the current implementation of
ISRSrange_axis(). Although duplicate area geometries did not show
to be harmful up to now, they do not seem to be useful and generally
duplicate geometries have the potential to make debugging of any
geometry processing harder.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 22 Mar 2019 14:35:32 +0100 |
parents | |
children | 29ef6d41e4af |
rev | line source |
---|---|
2781
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
1 -- This is Free Software under GNU Affero General Public License v >= 3.0 |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
2 -- without warranty, see README.md and license for details. |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
3 |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
4 -- SPDX-License-Identifier: AGPL-3.0-or-later |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
5 -- License-Filename: LICENSES/AGPL-3.0.txt |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
6 |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
7 -- Copyright (C) 2019 by via donau |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
8 -- – Österreichische Wasserstraßen-Gesellschaft mbH |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
9 -- Software engineering by Intevation GmbH |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
10 |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
11 -- Author(s): |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
12 -- * Tom Gottfried <tom@intevation.de> |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
13 |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
14 -- |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
15 -- pgTAP test script for gemma schema definition |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
16 -- |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
17 |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
18 SELECT throws_ok($$ |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
19 INSERT INTO waterway.waterway_axis (wtwaxs, objnam) VALUES |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
20 (ST_GeogFromText('LINESTRING(0 0, 1 1)'), 'test'), |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
21 (ST_GeogFromText('LINESTRING(0 0, 1 1)'), 'test') |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
22 $$, |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
23 23505, NULL, |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
24 'No duplicate geometries can be inserted into waterway_axis'); |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
25 |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
26 SELECT throws_ok($$ |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
27 INSERT INTO waterway.waterway_area (area) VALUES |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
28 (ST_GeogFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))')), |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
29 (ST_GeogFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))')) |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
30 $$, |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
31 23505, NULL, |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
32 'No duplicate geometries can be inserted into waterway_area'); |
a2127495093e
Prevent duplicate waterway axis and area geometries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
33 |