logo separator

[mkgmap-dev] [PATCH v3] Multipolygon: Improved role handling

From Marko Mäkelä marko.makela at iki.fi on Thu Mar 18 08:46:15 GMT 2010

Hi WanMil,

> The messages are generated because the generate-sea algorithm
> generated two polygons with role=inner and one of these polygons
> lies inside the other. I don't know if that's a bug of the
> generate-sea code or if the OSM data has a problem.

I could imagine that there could be two lakes or two islands within each other,
without an island or lake in between.  Or perhaps there could legitimately be
several "rings" of nested islands and lakes, and generate-sea is not prepared
for that.

I summarized the warnings I get for finland.osm.bz2:

sed -e 's/^.* WARNING (\(.*\)):.*/\1/' <mkgmap.log.0 |sort|uniq -c
     13 MapBuilder (highway has no region)
     68 MultiPolygonRelation
     73 RestrictionRelation (ignored unsupported tags or via ways)
    887 RoadDef  (discarding extra label (already have 4))
      3 RouteNode (dead-end oneways, now suppressed by adding fixme=continue)

Now, let us see those MultiPolygonRelation warnings with generated IDs:

2010/03/18 08:59:59 WARNING (MultiPolygonRelation): 63240001.osm.gz: Multipolygon http://www.openstreetmap.org/browse/relation/384611 contains errors.
2010/03/18 08:59:59 WARNING (MultiPolygonRelation): 63240001.osm.gz: Polygon 4611686018427395994(14P : (51767205[14P]) carries role outer but lies inside an outer polygon. Potentially its role should be inner.

This one could be an error in the map data.  I do not understand what the
relation is about (something about snow coverage), and I am ignoring this one.
Last time I checked, there was a L-shaped unclosed line in the relation,
but now the error seems different.

2010/03/18 09:06:13 WARNING (MultiPolygonRelation): 63240002.osm.gz: Multipolygon http://www.openstreetmap.org/browse/relation/405789 contains errors.
2010/03/18 09:06:13 WARNING (MultiPolygonRelation): 63240002.osm.gz: Polygon 4611686018427450887(6P : (23545368[6P]) carries role inner but is not inside any other polygon. Potentially it does not belong to this multipolygon.

I guess that this is a tile-splitter problem.

2010/03/18 09:06:17 WARNING (MultiPolygonRelation): 63240002.osm.gz: Multipolygon http://www.openstreetmap.org/browse/relation/406008 contains errors.
2010/03/18 09:06:17 WARNING (MultiPolygonRelation): 63240002.osm.gz: Polygon 4611686018427452464(11P : (25662847[10P]) carries role inner but is not inside any other polygon. Potentially it does not belong to this multipolygon.

This one should be a Geofabrik problem (near the cutting polygon)

2010/03/18 09:07:13 WARNING (MultiPolygonRelation): 63240003.osm.gz: Multipolygon http://www.openstreetmap.org/browse/relation/87598 contains errors.
2010/03/18 09:07:13 WARNING (MultiPolygonRelation): 63240003.osm.gz: Polygon 4611686018427459670(5P : (31747976[5P]) carries role inner but is not inside any other polygon. Potentially it does not belong to this multipolygon.

Geofabrik problem.

2010/03/18 09:08:53 WARNING (MultiPolygonRelation): 63240004.osm.gz: Multipolygon http://www.openstreetmap.org/browse/relation/88837 contains errors.
2010/03/18 09:08:53 WARNING (MultiPolygonRelation): 63240004.osm.gz: Polygon 4611686018427482392(1P : (31828356[1P]) carries role inner but is not inside any other polygon. Potentially it does not belong to this multipolygon.

Geofabrik problem.

2010/03/18 09:08:53 WARNING (MultiPolygonRelation): 63240004.osm.gz: Multipolygon http://www.openstreetmap.org/browse/relation/253359 contains errors.
2010/03/18 09:08:53 WARNING (MultiPolygonRelation): 63240004.osm.gz: Polygon 4611686018427483191(10P : (40982083[10P]) carries role inner but is not inside any other polygon. Potentially it does not belong to this multipolygon.

Geofabrik problem.

2010/03/18 09:08:53 WARNING (MultiPolygonRelation): 63240004.osm.gz: Multipolygon http://www.openstreetmap.org/browse/relation/287119 contains errors.
2010/03/18 09:08:53 WARNING (MultiPolygonRelation): 63240004.osm.gz: Polygon 4611686018427483237(18P : (42303932[17P]) carries role inner but is not inside any other polygon. Potentially it does not belong to this multipolygon.
2010/03/18 09:08:53 WARNING (MultiPolygonRelation): 63240004.osm.gz: Polygon 4611686018427483238(7P : (23446571[6P]) carries role inner but is not inside any other polygon. Potentially it does not belong to this multipolygon.

Geofabrik problem.

2010/03/18 09:08:55 WARNING (MultiPolygonRelation): 63240004.osm.gz: Multipolygon http://www.openstreetmap.org/browse/relation/301046 contains errors.
2010/03/18 09:08:55 WARNING (MultiPolygonRelation): 63240004.osm.gz: Polygon 4611686018427484412(7P : (43036113[6P]) carries role inner but is not inside any other polygon. Potentially it does not belong to this multipolygon.
2010/03/18 09:08:55 WARNING (MultiPolygonRelation): 63240004.osm.gz: Polygon 4611686018427484414(8P : (43036115[7P]) carries role inner but is not inside any other polygon. Potentially it does not belong to this multipolygon.

Geofabrik problem.

Do you agree with my guess that these generated IDs must be coming from the
multipolygons quoted immediately above them?

Then, finally we have a mystery multipolygon where your patch did not
seem to help to identify the source:

2010/03/18 09:09:08 WARNING (MultiPolygonRelation): 63240004.osm.gz: Multipolygon http://www.openstreetmap.org/browse/relation/4611686018427488909 contains errors.
2010/03/18 09:09:08 WARNING (MultiPolygonRelation): 63240004.osm.gz: Polygon 4611686018427489620(65P : (4614558[65P]) carries role inner but lies inside an inner polygon. Potentially its role should be outer.
2010/03/18 09:09:08 WARNING (MultiPolygonRelation): 63240004.osm.gz: Polygon 4611686018427489967(18P : (42942687[18P]) carries role inner but lies inside an inner polygon. Potentially its role should be outer.
2010/03/18 09:09:08 WARNING (MultiPolygonRelation): 63240004.osm.gz: Polygon 4611686018427489992(28P : (52019072[28P]) carries role inner but lies inside an inner polygon. Potentially its role should be outer.

This would be in Northern Finland, most likely on the north tip of the Baltic sea,
near the Swedish border.  Let us see if my guess was right:

http://www.openstreetmap.org/browse/way/4614558
http://www.openstreetmap.org/browse/way/42942687
http://www.openstreetmap.org/browse/way/52019072

Right, all the objects are near Tornio/Haparanda, near the Finnish/Swedish
border.  I fixed it in JOSM.  It seems that the natural=coastline has
recently been changed to waterway=riverbank, but some islands were forgotten
as natural=coastline, and one island was a duplicate polygon.  One island
is natural=coastline bordered by waterway=riverbank and natural=coastline.
I will move the waterway=riverbank a little further to the coast, just around
the island.

Thanks for your help!

	Marko



More information about the mkgmap-dev mailing list