[PATCH v3] - Sub-optimal fix to limit excessive inter-node arc length

Hi, As most maps probably don't need this fix, here's a version of the patch that doesn't do the arc length limiting unless you specify the "--limit-arc-length" option. I have made the diagnostic message that is output when an arc length is too long into an error (was a warning) and it spells out what to do to get around the problem. Unless anyone has any issues with this, I intend to commit it (or something very similar) later this week. Cheers, Mark

On Mon, Apr 27, 2009 at 03:59:58PM +0100, Mark Burton wrote:
As most maps probably don't need this fix, here's a version of the patch that doesn't do the arc length limiting unless you specify the "--limit-arc-length" option. I have made the diagnostic message that is output when an arc length is too long into an error (was a warning) and it spells out what to do to get around the problem.
I tried out the patch on mkgmap r1022, and it made me aware of the problem with http://download.geofabrik.de/osm/europe/finland.osm.bz2 by emitting two identical warnings: SEVERE (RouteArc): Way null contains an arc whose length is too big to be encoded so the road will not be routable (you may use the --limit-arc-length option to work around this problem) [Suggestion: could it print the ref or the id if there is no name?] After adding --limit-arc-length, I got a different error message: SEVERE (StyledConverter): Way null contains a segment that is longer than 16383 (routing will fail for that way) Mark, could you have a look what is going wrong? I'm running the script at http://www.polkupyoraily.net/osm/files/osm2img.sh essentially as follows: splitter.jar --split-file=areas.list finland.osm mkgmap.jar --limit-arc-length -c mkgmap.args --family-name="OSM 28.04.2009" The referenced files are here: http://www.polkupyoraily.net/osm/files/areas.list http://www.polkupyoraily.net/osm/files/mkgmap.args Best regards, Marko

Hi Marko,
On Mon, Apr 27, 2009 at 03:59:58PM +0100, Mark Burton wrote:
As most maps probably don't need this fix, here's a version of the patch that doesn't do the arc length limiting unless you specify the "--limit-arc-length" option. I have made the diagnostic message that is output when an arc length is too long into an error (was a warning) and it spells out what to do to get around the problem.
I tried out the patch on mkgmap r1022, and it made me aware of the problem with http://download.geofabrik.de/osm/europe/finland.osm.bz2 by emitting two identical warnings:
SEVERE (RouteArc): Way null contains an arc whose length is too big to be encoded so the road will not be routable (you may use the --limit-arc-length option to work around this problem)
[Suggestion: could it print the ref or the id if there is no name?]
I don't think the id is available but I can look into getting the ref output. I will do that in a minute and post a new patch soon if possible.
After adding --limit-arc-length, I got a different error message:
SEVERE (StyledConverter): Way null contains a segment that is longer than 16383 (routing will fail for that way)
Mark, could you have a look what is going wrong?
What's wrong is that that way has a single segment that is too long for us to handle with the present code. If the code was smarter it could split that segment into chunks that were small enough to not cause a problem by just adding extra points. I don't have much spare time at the moment so I can't look at that right now but I will happily look at it in the future if no-one else beats me too it. If you can identify the way in question, just add some points to reduce the size of the segment. Clinton reported that the patch doesn't appear to make much difference to the processing time so I think we don't require the option to enable the code that checks for long segments. Cheers, Mark

Hi Mark, On Tue, Apr 28, 2009 at 12:52:50PM +0100, Mark Burton wrote:
What's wrong is that that way has a single segment that is too long for us to handle with the present code. If the code was smarter it could split that segment into chunks that were small enough to not cause a problem by just adding extra points. I don't have much spare time at the moment so I can't look at that right now but I will happily look at it in the future if no-one else beats me too it. If you can identify the way in question, just add some points to reduce the size of the segment.
I identified it with this patch: + String wayName = way.getName(); // only use for diagnostic messa ges + if(wayName == null) { + wayName = way.getTag("ref"); + if(wayName == null) + wayName = way.toString(); + } The way.toString() spits out the latitude and longitude, among other things: SEVERE (StyledConverter): Way WAY: null(67.09045886993408/23.672125339508057) [note=In public domain (original Kekoil work),note=*,source=Landsat,source=*,highway=unclassified,highway=*] contains a segment that is longer than 16383 (routing will fail for that way) With JOSM, I determined that it probably is this way: http://www.openstreetmap.org/browse/way/24731243/history Could the error message disclose the unit? 16383 doesn't say anything to me. How could the problem be fixed in the map data? Split the way into two in the middle? If this only affects the routing along this way, I think I will just ignore it for now. It seems to be a minor road in the almost unpopulated areas of Finland. Marko

Hi Marko,
I identified it with this patch:
+ String wayName = way.getName(); // only use for diagnostic messa ges + if(wayName == null) { + wayName = way.getTag("ref"); + if(wayName == null) + wayName = way.toString(); + }
The way.toString() spits out the latitude and longitude, among other things:
SEVERE (StyledConverter): Way WAY: null(67.09045886993408/23.672125339508057) [note=In public domain (original Kekoil work),note=*,source=Landsat,source=*,highway=unclassified,highway=*] contains a segment that is longer than 16383 (routing will fail for that way)
With JOSM, I determined that it probably is this way:
OK.
Could the error message disclose the unit? 16383 doesn't say anything to me.
Well, I am confused about the units as well given that Coord.distance() supposedly returns a value in metres but then RouteArc scales the arc length with convertMeters() (sic).
How could the problem be fixed in the map data? Split the way into two in the middle?
Yes, or into some smaller segments.
If this only affects the routing along this way, I think I will just ignore it for now. It seems to be a minor road in the almost unpopulated areas of Finland.
OK. Cheers, Mark
participants (2)
-
Mark Burton
-
Marko Mäkelä