
Hi All, I have stuck at following problem: There is relation 4764899: type=multipolygon highway=footway Line 336969927 as inner Line 336969921 as outer This is an area, probably it should include tag "area=yes", but actually it doesn't. Mkgmap creates a new polyline from multipolygon and polyline is processed according to rules in "lines" part of style. I haven't found any method to safely remove this line from my map. I have tried to added following rule to "relations" file: type=multipolygon & highway=* { set area=yes; } but this doesn't work, new tags aren't added to created polyline. This looks for me like a bug. Any ideas, how to deal with multipolygon? -- Best regards, Andrzej

Hi Andrzej, I agree that it looks strange, but it works when you use apply like this: type=multipolygon & highway=* { apply { set area=yes; } } The reason is rather simple: The method MultiPolygonRelation.processElements() which creates the polylines is called before style evaluation, so your version adds the tag to the relation but that tag is only evaluated within the style rules. You may also ask for mkgmap:mp_created=true in the rules. I can't reproduce that the lines rules are applied, with my test file that contains the complete relation only the polygon rules are used. I assume your input file contains only a part of the relation? Gerd
Date: Fri, 8 May 2015 22:13:20 +0200 From: popej@poczta.onet.pl To: mkgmap-dev@lists.mkgmap.org.uk Subject: [mkgmap-dev] problem with highways as multipolygons
Hi All,
I have stuck at following problem:
There is relation 4764899:
type=multipolygon highway=footway Line 336969927 as inner Line 336969921 as outer
This is an area, probably it should include tag "area=yes", but actually it doesn't. Mkgmap creates a new polyline from multipolygon and polyline is processed according to rules in "lines" part of style.
I haven't found any method to safely remove this line from my map. I have tried to added following rule to "relations" file:
type=multipolygon & highway=* { set area=yes; }
but this doesn't work, new tags aren't added to created polyline. This looks for me like a bug.
Any ideas, how to deal with multipolygon?
-- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd,
I agree that it looks strange, but it works when you use apply like this: type=multipolygon & highway=* { apply { set area=yes; } }
As I understand "apply" deals with relation's members, which aren't highways at all. I have already tried "apply" but this is simply wrong approach.
You may also ask for mkgmap:mp_created=true in the rules.
Does it mean that polyline is created form multipolygon and nothing else? I get about 600 objects in Poland which I would delete using this rule. All looks like good candidates for removal. And probably I should use complimentary rule in "polygons" file, to get proper support for these objects. Looks good for temporary solution.
I can't reproduce that the lines rules are applied, with my test file that contains the complete relation only the polygon rules are used. I assume your input file contains only a part of the relation?
See attached file with single relation. I get highway=footway as polyline. Here result of echotags: relation with added "area=yes" in style: 4764899 - [highway=footway,area=yes,type=multipolygon] highway in "lines" 4611686018427387910 (4764899) - [highway=footway,mkgmap:mp_created=true,mkgmap:stylefilter=polyline] Maybe you could create a new relation in MultiPolygonRelation.processElements()? Relation could include all tags form original relation and new polylines as members. This would allow for some processing in style. Note: default style deals with "highway=pedestrian & area=yes", but ignore "area" tag for most other types of highway. I think at least footway and stairs should be checked for "area". -- Best regards, Andrzej

Hi Andrzej, The apply tells mkgmap to add the tag area=yes to the members, and I think that's what you want. Note that the members of the mp-relation are not the members of the original OSM relation, they are the artifical ways. You are right, it turned out that MultiPolygonRelation creates 4 different ways for relation 4764899. Three have the tag mkgmap:stylefilter=polygon and are only passed through the polygons rules, one is passed through the lines rules, it has the tag mkgmap:stylefilter=polyline: 4611686018427387907 (4764899) - [highway=footway,mkgmap:stylefilter=polygon,mkgmap:cache_area_size=481.705810546875,mkgmap:mp_created=true] polygons 4611686018427387908 (4764899) - [highway=footway,mkgmap:stylefilter=polygon,mkgmap:cache_area_size=481.705810546875,mkgmap:mp_created=true] polygons 4611686018427387909 (4764899) - [highway=footway,mkgmap:stylefilter=polygon,mkgmap:cache_area_size=481.705810546875,mkgmap:mp_created=true] polygons 4611686018427387910 (4764899) - [mkgmap:stylefilter=polyline,highway=footway,mkgmap:mp_created=true] lines The comment for the last one : // Go through all original outer ways, create a copy, tag them // with the mp tags and mark them only to be used for polyline processing // This enables the style file to decide if the polygon information or // the simple line information should be used. I don't know why this is done, but it seems to be needed for something. The code for this was added with r1694, long before I started to look at mkgmap. Reg. highway=* and area=yes: I've also noticed that the default style ignores some combinations. Please post a patch. Gerd Date: Sat, 9 May 2015 15:06:59 +0200 From: popej@poczta.onet.pl To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] problem with highways as multipolygons Hi Gerd,
I agree that it looks strange, but it works when you use apply like this: type=multipolygon & highway=* { apply { set area=yes; } }
As I understand "apply" deals with relation's members, which aren't highways at all. I have already tried "apply" but this is simply wrong approach.
You may also ask for mkgmap:mp_created=true in the rules.
Does it mean that polyline is created form multipolygon and nothing else? I get about 600 objects in Poland which I would delete using this rule. All looks like good candidates for removal. And probably I should use complimentary rule in "polygons" file, to get proper support for these objects. Looks good for temporary solution.
I can't reproduce that the lines rules are applied, with my test file that contains the complete relation only the polygon rules are used. I assume your input file contains only a part of the relation?
See attached file with single relation. I get highway=footway as polyline. Here result of echotags: relation with added "area=yes" in style: 4764899 - [highway=footway,area=yes,type=multipolygon] highway in "lines" 4611686018427387910 (4764899) - [highway=footway,mkgmap:mp_created=true,mkgmap:stylefilter=polyline] Maybe you could create a new relation in MultiPolygonRelation.processElements()? Relation could include all tags form original relation and new polylines as members. This would allow for some processing in style. Note: default style deals with "highway=pedestrian & area=yes", but ignore "area" tag for most other types of highway. I think at least footway and stairs should be checked for "area". -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd,
The apply tells mkgmap to add the tag area=yes to the members, and I think that's what you want.
This was my first thought too, but:
Note that the members of the mp-relation are not the members of the original OSM relation, they are the artifical ways.
"Apply" adds tags to original members while I have problems with artificial ways. Artificial ways inherit tags form original relation, so I would expect, that tags added to relation would appear in artificial ways. As you explained, this is no true. "Apply" would work if there were created corresponding artificial relation too. I think it's ok, that multipolygon appears as polyline and polygon. That way we can create object for boundary and for area. Problem appears, when multipolygon has no "area" tag, which is quite possible, since multipolygon implies area. I have added a rule to correct this problem: highway=* & mkgmap:mp_created=true {add area=yes;} See attached patch, which corrects footway, path and steps with area too. Often highway=service is marked as area, but I think it could be usable to draw a road around area. -- Best regards, Andrzej

Hi Andrzej, can't test right now, but I really think that apply adds to the artificial members of mp-relations. I am not 100% sure that it doesn't change the original members, but I would be suprised. Reg. your patch: Do I get this right that you don't want to make these areas routable? I understand that routing through areas doesn't work very well right now but if you remove these ways from the network you'll see real gaps. I think we should rather always allow routing. Gerd Date: Sat, 9 May 2015 17:31:24 +0200 From: popej@poczta.onet.pl To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] problem with highways as multipolygons Hi Gerd,
The apply tells mkgmap to add the tag area=yes to the members, and I think that's what you want.
This was my first thought too, but:
Note that the members of the mp-relation are not the members of the original OSM relation, they are the artifical ways.
"Apply" adds tags to original members while I have problems with artificial ways. Artificial ways inherit tags form original relation, so I would expect, that tags added to relation would appear in artificial ways. As you explained, this is no true. "Apply" would work if there were created corresponding artificial relation too. I think it's ok, that multipolygon appears as polyline and polygon. That way we can create object for boundary and for area. Problem appears, when multipolygon has no "area" tag, which is quite possible, since multipolygon implies area. I have added a rule to correct this problem: highway=* & mkgmap:mp_created=true {add area=yes;} See attached patch, which corrects footway, path and steps with area too. Often highway=service is marked as area, but I think it could be usable to draw a road around area. -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd,
Reg. your patch: Do I get this right that you don't want to make these areas routable?
In most cases there is routable way across area and adding area boundary only clutters the map. I prefer to remove boundaries, but I can't claim that this is a better solution. Maybe other developers could add their opinions? -- Best regards, Andrzej

Hi Andrzej,
Reg. your patch: Do I get this right that you don't want to make these areas routable?
In most cases there is routable way across area and adding area boundary only clutters the map. I prefer to remove boundaries, but I can't claim that this is a better solution.
Maybe other developers could add their opinions?
Just one other point to consider: If such an area has a name it is likely that we find houses using this name in addr:street. These addresses will not be found when there is no other road with the right name. Maybe it is possible to implement a check which adds only adds these highways to the map when they are either needed for address search or for routing. I have no idea how complex the test for the routing would be. Gerd

Hi Gerd, I'm satisfied with current solution. I think the problem arise from micro-mapping, where many linear features get area shape. Since we usually have both approaches, line and area, we needn't to converted area to lines. Some idea how to check area: find any nodes, where routable ways connect to area. If there exist ways connecting these nodes inside area, then area is not needed for routing. -- Best regards, Andrzej

Hi Andrzej, okay, will think about this test. Reg. the patch I'll wait for some further comments from others. Gerd
Date: Sun, 10 May 2015 16:19:41 +0200 From: popej@poczta.onet.pl To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] problem with highways as multipolygons
Hi Gerd,
I'm satisfied with current solution. I think the problem arise from micro-mapping, where many linear features get area shape. Since we usually have both approaches, line and area, we needn't to converted area to lines.
Some idea how to check area: find any nodes, where routable ways connect to area. If there exist ways connecting these nodes inside area, then area is not needed for routing.
-- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (2)
-
Andrzej Popowski
-
Gerd Petermann