
I'm having troubles on rendering tunnels properly on secondary ways. I have my typ file with a dark line (0x11), in the line's style file I set: highway=secondary & ( network=e-road | int_ref=* ) [0x04 resolution 18-19 continue] highway=secondary [0x04 road_class=2 road_speed=3 resolution 20 *continue*] highway=secondary *& tunnel=yes* [*0x11* road_class=2 road_speed=3 resolution 21] however I can't see those tunnels... what's is wrong in the logic? I though i fully understand the meaning of "continue". On the other side on primary roads, where I have 0x10202 and 0x03 defined in the typ file I can see tunnels properly: highway=primary & ( network=e-road | int_ref=* ) [0x10202 resolution 15-17 continue] highway=primary [0x10202 road_class=3 road_speed=4 resolution 18-21 continue] highway=primary & tunnel=yes [0x11 road_class=3 road_speed=4 resolution 22] highway=primary [0x03 roadclass=3 road_speed=4 resolution 22] Any hint is appreciated, thanks Enrico

Hi Enrico, I think the problem is the order of lines. Your map contains two lines, and we don't know any way to make sure which one is on top. With primary roads you first add the tunnel, so I'd say you should do that also with secondary roads. Gerd Date: Mon, 20 Oct 2014 22:49:06 +0200 From: eliboni@gmail.com To: mkgmap-dev@lists.mkgmap.org.uk Subject: [mkgmap-dev] Rendering Tunnels I'm having troubles on rendering tunnels properly on secondary ways. I have my typ file with a dark line (0x11), in the line's style file I set: highway=secondary & ( network=e-road | int_ref=* ) [0x04 resolution 18-19 continue] highway=secondary [0x04 road_class=2 road_speed=3 resolution 20 continue] highway=secondary & tunnel=yes [0x11 road_class=2 road_speed=3 resolution 21] however I can't see those tunnels... what's is wrong in the logic? I though i fully understand the meaning of "continue". On the other side on primary roads, where I have 0x10202 and 0x03 defined in the typ file I can see tunnels properly: highway=primary & ( network=e-road | int_ref=* ) [0x10202 resolution 15-17 continue] highway=primary [0x10202 road_class=3 road_speed=4 resolution 18-21 continue] highway=primary & tunnel=yes [0x11 road_class=3 road_speed=4 resolution 22] highway=primary [0x03 roadclass=3 road_speed=4 resolution 22] Any hint is appreciated, thanks Enrico _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi, there is other reason to put more detailed condition first. With your rules for secondary highways, all secondary highways which aren't tunnels are analyzed till the end of style, quite probably triggering some catch-all condition like this one form default style: highway=* & highway!=proposed & area!=yes [0x07 road_class=0 road_speed=0 resolution 23] I think that line type 0x11 is not displayed on device unless you define it in TYP file. -- Best regards, Andrzej

Thanks for the feedback. Andrezej, 0x11 is defined in the TYP file - good catch on the fact *"secondary highways which aren't tunnels are analyzed"* at the end - although this should not impact the tunnels. Gerd, you are stating the map will contain two lines, since: highway=secondary [0x04 road_class=2 road_speed=3 resolution 20 *continue*] would anyway draw the line 0x04 from resolution 22 (to 24) and it likely appears "above" the tunnel one, right?. So the below should solve both the comments allowing me to see tunnels from resolution 22: highway=secondary & ( network=e-road | int_ref=* ) [0x04 resolution 18-19 continue] highway=secondary [0x04 road_class=2 road_speed=3 resolution 20-21 *continue*] highway=secondary *& tunnel=yes* [*0x11* road_class=2 road_speed=3 resolution 22] highway=secondary [0x04 road_class=2 road_speed=3 resolution 22] In facts with this I can see the tunnels properly for secondary lines BUT routing does not work anymore, I get "route calculation error" whatever destination I try to set. Pls. let me know if this triggers something on your minds! Thanks again, Enrico On Tue, Oct 21, 2014 at 11:07 AM, Andrzej Popowski <popej@poczta.onet.pl> wrote:
Hi,
there is other reason to put more detailed condition first. With your rules for secondary highways, all secondary highways which aren't tunnels are analyzed till the end of style, quite probably triggering some catch-all condition like this one form default style:
highway=* & highway!=proposed & area!=yes [0x07 road_class=0 road_speed=0 resolution 23]
I think that line type 0x11 is not displayed on device unless you define it in TYP file.
-- Best regards, Andrzej
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Enrico, with your latest rules, secondary highway with tunnel finishes processing of this object. Try this: highway=secondary & ( network=e-road | int_ref=* ) [0x04 resolution 18-19 continue] highway=secondary & tunnel=yes [0x11 resolution 22 continue] highway=secondary [0x04 road_class=2 road_speed=3 resolution 20] Don't make tunnels routable, since you will get 2 routable roads at the same place, which probably is not needed, unless you add different avoidances to each. Probably would be better to use a line outside routable lines (not lines 0x01 - 0x13). -- Best regards, Andrzej

I'll give a try with your proposal, I believe it might fix the routing however if I got it right, tunnels will not be visible as per my 1st email attempt. On the other side, related to your comment* "with your latest rules, secondary highway with tunnel finishes processing of this object*", I believe this was my intention: up to res 21 I'd like the line to appear as 0x04, from resolution 22 it should appear as 0x11 if a tunnel, otherwise 0x04 - no further processing is needed. Could you pls let me know why the reasoning is not correct? Thanks! On Tue, Oct 21, 2014 at 12:55 PM, Andrzej Popowski <popej@poczta.onet.pl> wrote:
Hi Enrico,
with your latest rules, secondary highway with tunnel finishes processing of this object. Try this:
highway=secondary & ( network=e-road | int_ref=* ) [0x04 resolution 18-19 continue] highway=secondary & tunnel=yes [0x11 resolution 22 continue] highway=secondary [0x04 road_class=2 road_speed=3 resolution 20]
Don't make tunnels routable, since you will get 2 routable roads at the same place, which probably is not needed, unless you add different avoidances to each. Probably would be better to use a line outside routable lines (not lines 0x01 - 0x13).
-- Best regards, Andrzej
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Enrico,
I believe this was my intention: up to res 21 I'd like the line to appear as 0x04, from resolution 22 it should appear as 0x11 if a tunnel, otherwise 0x04 - no further processing is needed. Could you pls let me know why the reasoning is not correct?
This is correct. I have assumed that you'd like to get 2 lines for tunnels: standard road and additional marking for tunnel. As I understand, routing parameters are only valid for layer 24 (or the last layer in a map). I would remove road_class and road_speed from line: highway=secondary [0x04 road_class=2 road_speed=3 resolution 20-21 continue] Maybe this is the reason for routing errors? -- Best regards, Andrzej

Dzięki Andrzej! By removing "road_class=2 road_speed=3" from the 2nd line, routing works and tunnels are visible - here is how it looks line: highway=secondary & ( network=e-road | int_ref=* ) [0x04 resolution 18-19 continue] highway=secondary [0x04 resolution 20-21 continue] highway=secondary & tunnel=yes [0x11 road_class=2 road_speed=3 resolution 22] highway=secondary [0x04 road_class=2 road_speed=3 resolution 22] All looks fine now, and routable! Enrico On Tue, Oct 21, 2014 at 3:30 PM, Andrzej Popowski <popej@poczta.onet.pl> wrote:
Hi Enrico,
I believe this was my intention: up to res 21 I'd like the line to appear as 0x04, from resolution 22 it should appear as 0x11 if a tunnel, otherwise 0x04 - no further processing is needed. Could you pls let me know why the reasoning is not correct?
This is correct. I have assumed that you'd like to get 2 lines for tunnels: standard road and additional marking for tunnel.
As I understand, routing parameters are only valid for layer 24 (or the last layer in a map). I would remove road_class and road_speed from line: highway=secondary [0x04 road_class=2 road_speed=3 resolution 20-21 continue]
Maybe this is the reason for routing errors?
-- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Enrico, I think this change should NOT have an influence on routing, so it would be an error in mkgmap if it does. Please double check this result. Gerd Date: Tue, 21 Oct 2014 23:33:31 +0200 From: eliboni@gmail.com To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] Rendering Tunnels Dzięki Andrzej! By removing "road_class=2 road_speed=3" from the 2nd line, routing works and tunnels are visible - here is how it looks line: highway=secondary & ( network=e-road | int_ref=* ) [0x04 resolution 18-19 continue] highway=secondary [0x04 resolution 20-21 continue] highway=secondary & tunnel=yes [0x11 road_class=2 road_speed=3 resolution 22] highway=secondary [0x04 road_class=2 road_speed=3 resolution 22] All looks fine now, and routable! Enrico On Tue, Oct 21, 2014 at 3:30 PM, Andrzej Popowski <popej@poczta.onet.pl> wrote: Hi Enrico,
I believe this was my intention: up to res 21 I'd like the line to
appear as 0x04, from resolution 22 it should appear as 0x11 if a
tunnel, otherwise 0x04 - no further processing is needed. Could you
pls let me know why the reasoning is not correct?
This is correct. I have assumed that you'd like to get 2 lines for tunnels: standard road and additional marking for tunnel. As I understand, routing parameters are only valid for layer 24 (or the last layer in a map). I would remove road_class and road_speed from line: highway=secondary [0x04 road_class=2 road_speed=3 resolution 20-21 continue] Maybe this is the reason for routing errors? -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Gerd thanks for the comment - it's likely a bug in facs: I tried again with same result, # WORKING OK enrico@gling:/opt/osm/test$ ls -l gmapsupp.img -rw-rw-r-- 1 enrico enrico 87724032 ott 22 00:15 gmapsupp.img #copied lines style file to lines_last adding "road_class=2 road_speed=3" enrico@gling:/opt/osm/mystyle/r2946/default$ diff lines lines_last 172c172 < highway=secondary [0x04 road_class=2 road_speed=3 resolution 20-21 continue] ---
highway=secondary [0x04 resolution 20-21 continue]
# ROUTING IS BROKEN enrico@gling:/opt/osm/test$ ls -l gmapsupp.img -rw-rw-r-- 1 enrico enrico 88676352 ott 22 21:30 gmapsupp.img note that the latter gmapsupp.img with broken routing is 1MB larger than the working one, so it has clearly something more in it while it should not if the routing graph is just the result of res 24 ways... On Wed, Oct 22, 2014 at 8:37 AM, Gerd Petermann < gpetermann_muenchen@hotmail.com> wrote:
Hi Enrico,
I think this change should NOT have an influence on routing, so it would be an error in mkgmap if it does. Please double check this result.
Gerd
------------------------------ Date: Tue, 21 Oct 2014 23:33:31 +0200 From: eliboni@gmail.com To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] Rendering Tunnels
Dzięki Andrzej! By removing "road_class=2 road_speed=3" from the 2nd line, routing works and tunnels are visible - here is how it looks line:
highway=secondary & ( network=e-road | int_ref=* ) [0x04 resolution 18-19 continue] highway=secondary [0x04 resolution 20-21 continue] highway=secondary & tunnel=yes [0x11 road_class=2 road_speed=3 resolution 22] highway=secondary [0x04 road_class=2 road_speed=3 resolution 22]
All looks fine now, and routable!
Enrico
On Tue, Oct 21, 2014 at 3:30 PM, Andrzej Popowski <popej@poczta.onet.pl> wrote:
Hi Enrico,
I believe this was my intention: up to res 21 I'd like the line to appear as 0x04, from resolution 22 it should appear as 0x11 if a tunnel, otherwise 0x04 - no further processing is needed. Could you pls let me know why the reasoning is not correct?
This is correct. I have assumed that you'd like to get 2 lines for tunnels: standard road and additional marking for tunnel.
As I understand, routing parameters are only valid for layer 24 (or the last layer in a map). I would remove road_class and road_speed from line: highway=secondary [0x04 road_class=2 road_speed=3 resolution 20-21 continue]
Maybe this is the reason for routing errors?
-- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Enrico, thanks for the info, I really seems that mkgmap writes invalid data in the case that doesn't work. I'll try to find out why... Gerd Date: Wed, 22 Oct 2014 21:43:51 +0200 From: eliboni@gmail.com To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] Rendering Tunnels Gerd thanks for the comment - it's likely a bug in facs: I tried again with same result, # WORKING OK enrico@gling:/opt/osm/test$ ls -l gmapsupp.img -rw-rw-r-- 1 enrico enrico 87724032 ott 22 00:15 gmapsupp.img #copied lines style file to lines_last adding "road_class=2 road_speed=3" enrico@gling:/opt/osm/mystyle/r2946/default$ diff lines lines_last 172c172 < highway=secondary [0x04 road_class=2 road_speed=3 resolution 20-21 continue] ---
highway=secondary [0x04 resolution 20-21 continue]
# ROUTING IS BROKEN enrico@gling:/opt/osm/test$ ls -l gmapsupp.img -rw-rw-r-- 1 enrico enrico 88676352 ott 22 21:30 gmapsupp.img note that the latter gmapsupp.img with broken routing is 1MB larger than the working one, so it has clearly something more in it while it should not if the routing graph is just the result of res 24 ways... On Wed, Oct 22, 2014 at 8:37 AM, Gerd Petermann <gpetermann_muenchen@hotmail.com> wrote: Hi Enrico, I think this change should NOT have an influence on routing, so it would be an error in mkgmap if it does. Please double check this result. Gerd Date: Tue, 21 Oct 2014 23:33:31 +0200 From: eliboni@gmail.com To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] Rendering Tunnels Dzięki Andrzej! By removing "road_class=2 road_speed=3" from the 2nd line, routing works and tunnels are visible - here is how it looks line: highway=secondary & ( network=e-road | int_ref=* ) [0x04 resolution 18-19 continue] highway=secondary [0x04 resolution 20-21 continue] highway=secondary & tunnel=yes [0x11 road_class=2 road_speed=3 resolution 22] highway=secondary [0x04 road_class=2 road_speed=3 resolution 22] All looks fine now, and routable! Enrico On Tue, Oct 21, 2014 at 3:30 PM, Andrzej Popowski <popej@poczta.onet.pl> wrote: Hi Enrico,
I believe this was my intention: up to res 21 I'd like the line to
appear as 0x04, from resolution 22 it should appear as 0x11 if a
tunnel, otherwise 0x04 - no further processing is needed. Could you
pls let me know why the reasoning is not correct?
This is correct. I have assumed that you'd like to get 2 lines for tunnels: standard road and additional marking for tunnel. As I understand, routing parameters are only valid for layer 24 (or the last layer in a map). I would remove road_class and road_speed from line: highway=secondary [0x04 road_class=2 road_speed=3 resolution 20-21 continue] Maybe this is the reason for routing errors? -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi programmers, attached is a patch. The problem: mkgmap r3337 doesn't check if a "road" is rendered at level 0. Because of this missing check it adds the road to the NOD file but doesn't write it at level 0, which causes broken routing. I don't know if this is an old error, at least I did not find a change that introduced it. The problem is partly caused by the way how we process rules. Up to now mkgmap sets an internal "road" flag when it finds the road_speed or road_class attributes within the square brakets. Later it processes the resolution/level information. Again later it processes the level statement to find out which resolution is placed in what level. When this is done it is clear whether a given resolution appears at level 0 which is the only one that is routabable. On the other hand, some routines simply check the "road" flag to determine if a line is a routable way or not using the GType.isRoad() method. I changed the meaning of isRoad() and added a method hasRoadAttribute() which can be used when the old meaning is needed. Maybe isRoad() should also verify the result of isRoutableLineType() ? Gerd Date: Wed, 22 Oct 2014 21:43:51 +0200 From: eliboni@gmail.com To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] Rendering Tunnels Gerd thanks for the comment - it's likely a bug in facs: I tried again with same result, # WORKING OK enrico@gling:/opt/osm/test$ ls -l gmapsupp.img -rw-rw-r-- 1 enrico enrico 87724032 ott 22 00:15 gmapsupp.img #copied lines style file to lines_last adding "road_class=2 road_speed=3" enrico@gling:/opt/osm/mystyle/r2946/default$ diff lines lines_last 172c172 < highway=secondary [0x04 road_class=2 road_speed=3 resolution 20-21 continue] ---
highway=secondary [0x04 resolution 20-21 continue]
# ROUTING IS BROKEN enrico@gling:/opt/osm/test$ ls -l gmapsupp.img -rw-rw-r-- 1 enrico enrico 88676352 ott 22 21:30 gmapsupp.img note that the latter gmapsupp.img with broken routing is 1MB larger than the working one, so it has clearly something more in it while it should not if the routing graph is just the result of res 24 ways... On Wed, Oct 22, 2014 at 8:37 AM, Gerd Petermann <gpetermann_muenchen@hotmail.com> wrote: Hi Enrico, I think this change should NOT have an influence on routing, so it would be an error in mkgmap if it does. Please double check this result. Gerd Date: Tue, 21 Oct 2014 23:33:31 +0200 From: eliboni@gmail.com To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] Rendering Tunnels Dzięki Andrzej! By removing "road_class=2 road_speed=3" from the 2nd line, routing works and tunnels are visible - here is how it looks line: highway=secondary & ( network=e-road | int_ref=* ) [0x04 resolution 18-19 continue] highway=secondary [0x04 resolution 20-21 continue] highway=secondary & tunnel=yes [0x11 road_class=2 road_speed=3 resolution 22] highway=secondary [0x04 road_class=2 road_speed=3 resolution 22] All looks fine now, and routable! Enrico On Tue, Oct 21, 2014 at 3:30 PM, Andrzej Popowski <popej@poczta.onet.pl> wrote: Hi Enrico,
I believe this was my intention: up to res 21 I'd like the line to
appear as 0x04, from resolution 22 it should appear as 0x11 if a
tunnel, otherwise 0x04 - no further processing is needed. Could you
pls let me know why the reasoning is not correct?
This is correct. I have assumed that you'd like to get 2 lines for tunnels: standard road and additional marking for tunnel. As I understand, routing parameters are only valid for layer 24 (or the last layer in a map). I would remove road_class and road_speed from line: highway=secondary [0x04 road_class=2 road_speed=3 resolution 20-21 continue] Maybe this is the reason for routing errors? -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (3)
-
Andrzej Popowski
-
Enrico Liboni
-
Gerd Petermann