ways are deleted when not routable

I have found another issue. Mkgmap (latest versions) is deleting parts of roads that are not routable at zoomlevels below 24. See screenshot at http://mijndev.openstreetmap.nl/~ligfietser/test/N301.jpg This is one of the parts that are removed at resolution 22 and below: http://www.openstreetmap.org/browse/way/6971876 I have tested it with two line types: highway=trunk [0x02 resolution 18] road is removed highway=trunk [0x02 road_class=4 road_speed=5 resolution 18] road is rendered It doesn't matter if I use a non routable line type for 0x02, or convert it into motorway. Any ideas what makes this road disappear? BTW I need to make motorways, trunk roads and all other non cyclable roads not routable, because access=no / bicycle=no is not working anymore in the latest devices and Basecamp. But I do want to see them rendered at the map and sometimes I see those holes. I have uploaded the map tile here: http://mijndev.openstreetmap.nl/~ligfietser/test/10010069.o5m

Hi Minko, might be related to the changes reg. exits. Do you use --process-exits or --process-destination? Gerd Minko-2 wrote
I have found another issue. Mkgmap (latest versions) is deleting parts of roads that are not routable at zoomlevels below 24. See screenshot at http://mijndev.openstreetmap.nl/~ligfietser/test/N301.jpg This is one of the parts that are removed at resolution 22 and below: http://www.openstreetmap.org/browse/way/6971876
I have tested it with two line types: highway=trunk [0x02 resolution 18] road is removed
highway=trunk [0x02 road_class=4 road_speed=5 resolution 18] road is rendered
It doesn't matter if I use a non routable line type for 0x02, or convert it into motorway. Any ideas what makes this road disappear?
BTW I need to make motorways, trunk roads and all other non cyclable roads not routable, because access=no / bicycle=no is not working anymore in the latest devices and Basecamp. But I do want to see them rendered at the map and sometimes I see those holes.
I have uploaded the map tile here: http://mijndev.openstreetmap.nl/~ligfietser/test/10010069.o5m _______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/ways-are-deleted-when-not-routable-tp5760424p... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Do you use --x-housenumbers ? If yes, please try without it. Gerd Minko-2 wrote
No I dont use them Gerd.
Hi Minko,
might be related to the changes reg. exits. Do you use --process-exits or --process-destination?
Gerd
mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/ways-are-deleted-when-not-routable-tp5760424p... Sent from the Mkgmap Development mailing list archive at Nabble.com.

OK, thanks. I try to find out what happens. Gerd
Date: Fri, 10 May 2013 11:40:14 +0200 From: ligfietser@online.nl To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] ways are deleted when not routable
I use it but even without x-housenumbers, the roads disappear (mkgmap-r2586)
Do you use --x-housenumbers ? If yes, please try without it.
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Thanks, You can see this behaviour by editting the following line in the default style: #highway=trunk [0x02 road_class=4 road_speed=5 resolution 18] highway=trunk [0x02 resolution 18] I think other mkgmap options don't matter but anyway here it is: name-tag-list: name,int_name,name:en,name:nl,name:de,name:fr,place_name generate-sea: land-tag=natural=background precomp-sea: C:\Downloads\Sea\sea_20130415.zip bounds: c:\Downloads\Boundaries\bounds_20130420.zip location-autofill: is-in,nearest x-housenumbers tdbfile latin1 code-page: 1252 show-profiles: 1 ignore-maxspeeds add-pois-to-areas add-pois-to-lines preserve-element-order keep-going net route index
OK, thanks. I try to find out what happens.
Gerd

Hi Minko, the problem is caused by the merge-lines routine. You see the problem also in a map created with r2570 if you look at res < 22. It seems that it causes trouble when a MapLine that has the direction flag set is merged with another line. The flag is set if the OSM way is a oneway. I don't know why this is also done for non-routable ways, but that's how it is coded since 2008. Maybe Steve has an explanation? The attached small patch seems to fix the problem by excluding all oneways from merging, of course this makes the *.img a bit larger. I also tried to simply set the directionflag to false for all non-routable ways, but that did not help. Any idea would be welcome. excl_oneways_from_merging_v1.patch <http://gis.19327.n5.nabble.com/file/n5760488/excl_oneways_from_merging_v1.patch> A compiled binary is here: http://files.mkgmap.org.uk/download/122/mkgmap.jar Gerd Minko-2 wrote
Thanks, You can see this behaviour by editting the following line in the default style: #highway=trunk [0x02 road_class=4 road_speed=5 resolution 18] highway=trunk [0x02 resolution 18]
I think other mkgmap options don't matter but anyway here it is:
name-tag-list: name,int_name,name:en,name:nl,name:de,name:fr,place_name generate-sea: land-tag=natural=background precomp-sea: C:\Downloads\Sea\sea_20130415.zip bounds: c:\Downloads\Boundaries\bounds_20130420.zip location-autofill: is-in,nearest x-housenumbers tdbfile latin1 code-page: 1252 show-profiles: 1 ignore-maxspeeds add-pois-to-areas add-pois-to-lines preserve-element-order keep-going net route index
OK, thanks. I try to find out what happens.
Gerd
mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/ways-are-deleted-when-not-routable-tp5760424p... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi, I hesitate to commit this patch as I don't really believe that the direction flag itself is the problem here. I assume that a line with the direction flag must follow some special rules and the merge-lines method doesn't care. If anybody has an idea, please let me know, else I'll commit the patch tomorrow. Gerd Minko-2 wrote
Your patch seems to solve this, thanks.
-- View this message in context: http://gis.19327.n5.nabble.com/ways-are-deleted-when-not-routable-tp5760424p... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Gerd, as far as I have understood the problem appears with ways that have a routable type but no road class and road type and are oneway. This is not allowed (it doesn't pass the check-style command). So I don't see a problem that has to be fixed?!? But probably I have missed something in the long discussion... WanMil
Hi,
I hesitate to commit this patch as I don't really believe that the direction flag itself is the problem here. I assume that a line with the direction flag must follow some special rules and the merge-lines method doesn't care. If anybody has an idea, please let me know, else I'll commit the patch tomorrow.
Gerd
Minko-2 wrote
Your patch seems to solve this, thanks.
-- View this message in context: http://gis.19327.n5.nabble.com/ways-are-deleted-when-not-routable-tp5760424p... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi WanMil, I did not verify, but Minko wrote "It doesn't matter if I use a non routable line type for 0x02, or convert it into motorway. " Gerd WanMil wrote
Hi Gerd,
as far as I have understood the problem appears with ways that have a routable type but no road class and road type and are oneway. This is not allowed (it doesn't pass the check-style command). So I don't see a problem that has to be fixed?!?
But probably I have missed something in the long discussion...
-- View this message in context: http://gis.19327.n5.nabble.com/ways-are-deleted-when-not-routable-tp5760424p... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Wanmil, It is a problem because also non routable lines are deleted, and I use non routable lines for motorways and all other roads that are not accesible for bicycles on my cycle map. Those roads have to be rendered but somehow in certain cases (oneway direction?) those lines are removed from resolution 22 and lower by mkgmap which is not so nice.
Hi Gerd,
as far as I have understood the problem appears with ways that have a routable type but no road class and road type and are oneway. This is not allowed (it doesn't pass the check-style command). So I don't see a problem that has to be fixed?!?
But probably I have missed something in the long discussion...
WanMil
Hi,
I hesitate to commit this patch as I don't really believe that the direction flag itself is the problem here. I assume that a line with the direction flag must follow some special rules and the merge-lines method doesn't care. If anybody has an idea, please let me know, else I'll commit the patch tomorrow.
Gerd
Minko-2 wrote
Your patch seems to solve this, thanks.
-- View this message in context: http://gis.19327.n5.nabble.com/ways-are-deleted-when-not-routable-tp5760424p... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Minko, does your style pass the check-style checks without errors? WanMil
Hi Wanmil, It is a problem because also non routable lines are deleted, and I use non routable lines for motorways and all other roads that are not accesible for bicycles on my cycle map. Those roads have to be rendered but somehow in certain cases (oneway direction?) those lines are removed from resolution 22 and lower by mkgmap which is not so nice.
Hi Gerd,
as far as I have understood the problem appears with ways that have a routable type but no road class and road type and are oneway. This is not allowed (it doesn't pass the check-style command). So I don't see a problem that has to be fixed?!?
But probably I have missed something in the long discussion...
WanMil
Hi,
I hesitate to commit this patch as I don't really believe that the direction flag itself is the problem here. I assume that a line with the direction flag must follow some special rules and the merge-lines method doesn't care. If anybody has an idea, please let me know, else I'll commit the patch tomorrow.
Gerd
Minko-2 wrote
Your patch seems to solve this, thanks.
-- View this message in context: http://gis.19327.n5.nabble.com/ways-are-deleted-when-not-routable-tp5760424p... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Wanmil, Yes, it passes without errors, because I use a non routable line. In short you can see the problem in this pic: http://mijndev.openstreetmap.nl/~ligfietser/test/N301.jpg Left image is zoomed out, some roads (like the N301 - a non routable line on my map, http://www.openstreetmap.org/browse/way/120708550) are deleted in occasional situations. It became worse after r2570. Right image is when zoomed in, they are rendered ok. The default style doesn't show this behaviour, unless I remove the road attributes from the trunk road and the same thing happens. It doesn't matter if I use a routable or non routable line for this, they are always removed. On http://mijndev.openstreetmap.nl/~ligfietser/test/10010069.o5m you can find the OSM file of this area.
does your style pass the check-style checks without errors?
WanMil
Hi Wanmil, It is a problem because also non routable lines are deleted, and I use non routable lines for motorways and all other roads that are not accesible for bicycles on my cycle map. Those roads have to be rendered but somehow in certain cases (oneway direction?) those lines are removed from resolution 22 and lower by mkgmap which is not so nice.

Hi
The attached small patch seems to fix the problem by excluding all oneways from merging, of course this makes the *.img a bit larger. I also tried to simply set the directionflag to false for all non-routable ways, but that did not help. Any idea would be welcome.
Lines should not be merged if they have different one way properties I would have thought. So MapElement.isSimilar() should return false if line.isDirection() != otherLine.isDirection() or they both are one-way and they run in opposite directions. (The method would have to be pushed down into MapLine, but it is only used on lines anyway). Don't know if this has anything to do with the disappearing lines though as that seems a bit odd... Are the lines really in the map and just not displayed by mapsource etc.? ..Steve

Lines should not be merged if they have different one way properties I would have thought.
So MapElement.isSimilar() should return false if line.isDirection() != otherLine.isDirection() or they both are one-way and they run in opposite directions. (The method would have to be pushed down into MapLine, but it is only used on lines anyway).
I thought the same, but it did not solve the problem completely. In the example from Minko, I still found a (smaller) hole. There are many small fragments named N301 which are joined.
Don't know if this has anything to do with the disappearing lines though as that seems a bit odd... Are the lines really in the map and just not displayed by mapsource etc.?
I'll have a closer look again. Gerd

The lines are gone, even if I look with gpsmapedit there is nothing. I've even tried to delete the oneway attribute before treating the trunk road, but this doesn't solve it.
Don't know if this has anything to do with the disappearing lines though as that seems a bit odd... Are the lines really in the map and just not displayed by mapsource etc.?
I'll have a closer look again.
Gerd

Hi all, the problem is not directly related to oneways. Here is what happens: The merge-line method merges some OSM ways, but it doesn't care about the direction of parallel lines or loops and it may also remove the preserved flag from a point that connnects two lines. In this special case, it joins the points of the OSM ways 6971876, 120708547, 6971870, 120708550, and 6971878 to form a rather small circle plus a long line: d-------------------------------x--c a--b The merged line starts at point x (!) and goes via a,b,c, back to x and then to d. The Douglas-Peucker-Filter finds that the small loop is all within the error tolerance and removes it, so that the remaining way is the line between x and d. d-------------------------------x I've committed r2606 to fix this error. Whenever the merge-lines method merges two lines, it sets the preserved flag for the connection point. This solves the problem and causes only a small increase of the img size. Gerd
Date: Mon, 13 May 2013 09:13:15 +0200 From: ligfietser@online.nl To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] ways are deleted when not routable
The lines are gone, even if I look with gpsmapedit there is nothing. I've even tried to delete the oneway attribute before treating the trunk road, but this doesn't solve it.
Don't know if this has anything to do with the disappearing lines though as that seems a bit odd... Are the lines really in the map and just not displayed by mapsource etc.?
I'll have a closer look again.
Gerd
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Thanks Gerd for solving the problem! Was this error only related to lines and were routable roads merged different?
I've committed r2606 to fix this error. Whenever the merge-lines method merges two lines, it sets the preserved flag for the connection point. This solves the problem and causes only a small increase of the img size.
Gerd

Hi Minko, Minko-2 wrote
Was this error only related to lines and were routable roads merged different?
the merging works in the same way, but the endpoints of roads are nodes which are preserved from being filtered. Gerd -- View this message in context: http://gis.19327.n5.nabble.com/ways-are-deleted-when-not-routable-tp5760424p... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Steve, don't think so. We saw these problems when merge-lines was deactivated for resolution 24, didn't we? Current implementation merges roads and non-roads if res < 24, and that should not affect routing. Gerd Steve Ratcliffe wrote
Hi
Lines should not be merged if they have different one way properties I would have thought.
Also a road and non-road should not be merged. Perhaps that is one of the reasons why using routable types as non-roads caused routing problems?
..Steve _______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/ways-are-deleted-when-not-routable-tp5760424p... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Some more info, just checked it with mkgmap version 2570 which seems ok, so it must be in the later revisions, I think routable_types_v6.patch is the cause (2573)?
I have tested it with two line types: highway=trunk [0x02 resolution 18] road is removed
highway=trunk [0x02 road_class=4 road_speed=5 resolution 18] road is rendered
It doesn't matter if I use a non routable line type for 0x02, or convert it into motorway. Any ideas what makes this road disappear?
BTW I need to make motorways, trunk roads and all other non cyclable roads not routable, because access=no / bicycle=no is not working anymore in the latest devices and Basecamp. But I do want to see them rendered at the map and sometimes I see those holes.
I have uploaded the map tile here: http://mijndev.openstreetmap.nl/~ligfietser/test/10010069.o5m

On 10.05.2013 04:52, Minko wrote:
I have found another issue. Mkgmap (latest versions) is deleting parts of roads that are not routable at zoomlevels below 24. See screenshot at http://mijndev.openstreetmap.nl/~ligfietser/test/N301.jpg This is one of the parts that are removed at resolution 22 and below: http://www.openstreetmap.org/browse/way/6971876
I have tested it with two line types: highway=trunk [0x02 resolution 18] road is removed
highway=trunk [0x02 road_class=4 road_speed=5 resolution 18] road is rendered
you could use 0x02 resolution 18-23, then another type for trunk highways. Routable types shouldn#t be used for non routable lines..... - at least not if map is built with address search. So far in Garmin maps, if 0x01, 0x02 wasn't routable, but the map itself is routable, then it has no address search at all (true for some Topo maps), your style-file woudn't pass the check-styles command of mkgmap in above case...

I have tested it with two line types: highway=trunk [0x02 resolution 18] road is removed
highway=trunk [0x02 road_class=4 road_speed=5 resolution 18] road is rendered
you could use 0x02 resolution 18-23, then another type for trunk highways. Routable types shouldn#t be used for non routable lines..... - at least not if map is built with address search. So far in Garmin maps, if 0x01, 0x02 wasn't routable, but the map itself is routable, then it has no address search at all (true for some Topo maps),
your style-file woudn't pass the check-styles command of mkgmap in above case...
Hi Felix, Yes I know, in my own style I use extended non routable line types for those ways, but I saw that in the default style this road was rendered ok. So to reproduce this bug, I took the default style and removed the routable attributes on the trunk highways to see if the same would happen (which was true). So the only thing that triggered the lines to disappear were the routable attributes, and Gerd found out that it also was related to the oneway directions.
participants (6)
-
Felix Hartmann
-
Gerd Petermann
-
GerdP
-
Minko
-
Steve Ratcliffe
-
WanMil