Multipolygon artificial tagging

Hi Marko and others, the patch for the mp code does not remove any tags from the source polygons and lines. Instead it tags all mp-source lines and polygons with mkgmap:mp_source=yes. All artificially created polygons during the mp processing are tagged with mkgmap:mp_created=yes. Example: Polygon A - natural=water, role=outer Polygon B - landuse=grass, role=inner Result after mp processing Polygon A - natural=water, role=outer, mkgmap:mp_source=yes Polygon B - landuse=grass, role=inner, mkgmap:mp_source=yes Polygon A1 - natural=water, mkgmap:mp_created=yes Polygon A2 - natural=water, mkgmap:mp_created=yes Polygon B1 - landuse=grass, mkgmap:mp_created=yes Maybe you could play a bit with this and post any new ideas how to improve the tag handling in the mp code. WanMil

Hi WanMil,
the patch for the mp code does not remove any tags from the source polygons and lines. Instead it tags all mp-source lines and polygons with mkgmap:mp_source=yes.
All artificially created polygons during the mp processing are tagged with mkgmap:mp_created=yes.
Example: Polygon A - natural=water, role=outer Polygon B - landuse=grass, role=inner
Result after mp processing Polygon A - natural=water, role=outer, mkgmap:mp_source=yes Polygon B - landuse=grass, role=inner, mkgmap:mp_source=yes
Polygon A1 - natural=water, mkgmap:mp_created=yes Polygon A2 - natural=water, mkgmap:mp_created=yes Polygon B1 - landuse=grass, mkgmap:mp_created=yes
Maybe you could play a bit with this and post any new ideas how to improve the tag handling in the mp code.
How would this remove the bogus boundary lines in Germany? (Germany uses multipolygons for administrative boundaries.) I believe that for those to work, the multipolygon code should be disabled by a style rule, e.g., use the MP code only if type=multipolygon & boundary!=*. Someone who wants to render boundaries as multipolygons would enable the MP processing of the boundaries. Or would we make this by an option, something like mkgmap --disable-multipolygon='boundary=*'? An alternative to disabling MP processing would be to set mkgmap:mp_created only on the line segments that were created when splitting A to A1 and A2, but I suppose that polygons and lines are wholly different entities in mkgmap, and thus you cannot have differently tagged line segments within a polygon. Marko

Moin, I tried a slightly modified patch provided by WanMil, where also mkgmap:mp_*=no tags are added:
the patch for the mp code does not remove any tags from the source polygons and lines. Instead it tags all mp-source lines and polygons with mkgmap:mp_source=yes and mkgmap:mp_created=no.
All artificially created polygons during the mp processing are tagged with mkgmap:mp_created=yes and mkgmap:mp_source=no.
Example: Polygon A - natural=water, role=outer Polygon B - landuse=grass, role=inner
Result after mp processing Polygon A - natural=water, role=outer, mkgmap:mp_source=yes Polygon B - landuse=grass, role=inner, mkgmap:mp_source=yes
Polygon A1 - natural=water, mkgmap:mp_created=yes Polygon A2 - natural=water, mkgmap:mp_created=yes Polygon B1 - landuse=grass, mkgmap:mp_created=yes
With this patch I was able to fix the multipolygon borders commonly used in Germany, by modifying my style as follows. For the border lines I don't want to have the artificially created polygons, I am only interested in the original polygons from the multi-polygon. So I added to each border check the condition mkgmap:mp_created!=yes. As a result only the original polygons from a multi-polygon are drawn as borderlines as well as all lines not belonging to a multi-polygon. The second change was done in the polygon files. Here I added to every check the condition mkgmap:mp_created!=no. As a result only the artificially created polygons are drawn as areas as well as all polygons not belonging to a multi-polygon. So in my eyes with this patch the multi-polygon processing is much better controllable via the style file. But you have to adjust your style accordingly, so that you do not output both polygons, the original and the artificial one. Gruss Torsten

Moin,
I tried a slightly modified patch provided by WanMil, where also mkgmap:mp_*=no tags are added:
the patch for the mp code does not remove any tags from the source polygons and lines. Instead it tags all mp-source lines and polygons with mkgmap:mp_source=yes and mkgmap:mp_created=no.
All artificially created polygons during the mp processing are tagged with mkgmap:mp_created=yes and mkgmap:mp_source=no.
Example: Polygon A - natural=water, role=outer Polygon B - landuse=grass, role=inner
Result after mp processing Polygon A - natural=water, role=outer, mkgmap:mp_source=yes Polygon B - landuse=grass, role=inner, mkgmap:mp_source=yes
Polygon A1 - natural=water, mkgmap:mp_created=yes Polygon A2 - natural=water, mkgmap:mp_created=yes Polygon B1 - landuse=grass, mkgmap:mp_created=yes
With this patch I was able to fix the multipolygon borders commonly used in Germany, by modifying my style as follows.
For the border lines I don't want to have the artificially created polygons, I am only interested in the original polygons from the multi-polygon. So I added to each border check the condition mkgmap:mp_created!=yes. As a result only the original polygons from a multi-polygon are drawn as borderlines as well as all lines not belonging to a multi-polygon.
The second change was done in the polygon files. Here I added to every check the condition mkgmap:mp_created!=no. As a result only the artificially created polygons are drawn as areas as well as all polygons not belonging to a multi-polygon.
So in my eyes with this patch the multi-polygon processing is much better controllable via the style file. But you have to adjust your style accordingly, so that you do not output both polygons, the original and the artificial one.
Gruss Torsten
Torsten, thanks for testing the patch! I am a bit unhappy about the fact that the mkgmap:mp_created!=no must be added to each rule. Isn't there a rule like mkgmap:mp_created!=no [break] which breaks (polygon) processing if the artificial tag is not set? WanMil
participants (3)
-
Marko Mäkelä
-
Torsten Leistikow
-
WanMil