add failing test-case for #18

multipolygons that are not closed (topological) can be handled by
using GEOS LineMerge function. It's expected to be slower than the
node ID based merger. Maybe it's feasible to use LineMerge as a
fallback.
master
Oliver Tonnhofer 2014-02-05 10:04:00 +01:00
parent 48486e7280
commit ff6207d200
2 changed files with 29 additions and 0 deletions

View File

@ -434,6 +434,11 @@ def test_generalized_linestring_is_valid():
assert road['geometry'].is_valid, road['geometry'].wkt
assert road['geometry'].length > 1000000
@unittest.skip("not implemented")
def test_relation_with_gap():
"""Multipolygon with gap (overlapping but different endpoints) gets closed"""
park = query_row(db_conf, 'osm_landusages', -7301)
assert park['geometry'].is_valid, park
#######################################################################
def test_update():

View File

@ -341,6 +341,30 @@
<tag k="name" v="self-intersecting"/>
</way>
<!-- relation with "gap" (ways overlap, but are only sharing one endpoint) -->
<node id="7301" version="1" timestamp="2011-11-11T00:11:11Z" lat="60" lon="60"/>
<node id="7302" version="1" timestamp="2011-11-11T00:11:11Z" lat="60" lon="62"/>
<node id="7303" version="1" timestamp="2011-11-11T00:11:11Z" lat="62" lon="62"/>
<node id="7313" version="1" timestamp="2011-11-11T00:11:11Z" lat="62" lon="62"/>
<node id="7314" version="1" timestamp="2011-11-11T00:11:11Z" lat="62" lon="60"/>
<way id="7301" version="1" timestamp="2011-11-11T00:11:11Z">
<nd ref="7301"/>
<nd ref="7302"/>
<nd ref="7303"/>
</way>
<way id="7302" version="1" timestamp="2011-11-11T00:11:11Z">
<nd ref="7313"/> <!-- same coord as 7303 -->
<nd ref="7314"/>
<nd ref="7301"/>
</way>
<relation id="7301" version="1" timestamp="2011-11-11T00:11:11Z">
<member type="way" ref="7301" role="outer"/>
<member type="way" ref="7302" role="outer"/>
<tag k="name" v="rel 7301"/>
<tag k="landuse" v="park"/>
<tag k="type" v="multipolygon"/>
</relation>
<!-- test that single node ways or incomplete polygons are _not_ inserted -->
<node id="30001" version="1" timestamp="2011-11-11T00:11:11Z" lat="47" lon="80"/>
<node id="30002" version="1" timestamp="2011-11-11T00:11:11Z" lat="47" lon="80"/>