Mercurial > gemma
diff schema/isrs_tests.sql @ 2232:7936b46a88d4
Handle invalid multipolygons in area generation from stretch
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Wed, 13 Feb 2019 11:44:27 +0100 |
parents | 40711ca3aa19 |
children | 8481e6266691 |
line wrap: on
line diff
--- a/schema/isrs_tests.sql Wed Feb 13 11:13:06 2019 +0100 +++ b/schema/isrs_tests.sql Wed Feb 13 11:44:27 2019 +0100 @@ -81,4 +81,22 @@ - ST_XMin(:'test_area'::geometry))/2 + 0.1), 0)), 4326))), - 'Two intersecting polygons lead to two polygons in result'); + 'Two polygons intersecting the axis lead to two polygons in result'); + +SELECT ok( + 1 = ST_NumGeometries( + ISRSrange_area( + isrsrange( + ('AT', 'XXX', '00001', '00000', 0)::isrs, + ('AT', 'XXX', '00001', '00000', 1)::isrs), + ST_SetSRID(ST_Collect( + ST_Translate(:'test_area', + (ST_XMax(:'test_area'::geometry) + - ST_XMin(:'test_area'::geometry))/3, + 0), + ST_Translate(:'test_area', + -((ST_XMax(:'test_area'::geometry) + - ST_XMin(:'test_area'::geometry))/3), + 0)), + 4326))), + 'Self-intersecting multipolygon leads to one polygon in result');