
The good news is that this should now no longer falsely complain about a flare road being the wrong direction when that flare road pair are the only roads connected to a given roundabout. The bad news is that it will now find more bad flare roads than it did before - and you thought you had fixed them all!

Hi, mkgmap is dropping international boundaries from a maps (OSM file format but not a download from OMS) without issuing any error message or warning. I checked the image files in mapsource as well as with gpsmapedit, and the national boundaries are not included in the img file. I created a test file to demonstrate the issue with only three line types, national boundaries, provincial boundaries and minor contours, and have uploaded it here. Size = 98.1 MB. http://dl.dropbox.com/u/4900023/cambodia.osm Things I have tried: a) I compiled the original source file in mp format and it works correctly. b) I reduced the OSM file to the smallest size that demonstrated the error by deleting contour lines. If I delete one more contour line from the end of the file the error goes away and international boundaries are displayed. c) I loaded the file in JOSM and checked it. The international boundaries displayed correctly. I saved the file to a new file name, and although the elements were rearranged and the file size increased, the international boundaries were still dropped when I compiled the file. d) I compiled with no options set, and checked the img with gpsmapedit, and it WORKED correctly. The boundaries displayed in the img file. e) After further experimentation I found that removing --remove-short-arcs=5 from the command line cause the international boundaries to display correctly. Command line java -ea -Xmx2000m -jar ./mkgmap-1581/mkgmap.jar --remove-short-arcs=5 cambodia.osm Does not work. Thanks for any help Garvan

Hello Garvan,
If you zip up that file to save my bandwidth, I will take a look at it. Mark

Mark Burton wrote:
Hello Garvan,
If you zip up that file to save my bandwidth, I will take a look at it.
Mark
Sorry, wasn't thinking. http://dl.dropbox.com/u/4900023/cambodia.osm.zip Garvan

Well, I looked at it but learnt nothing. I just get an empty map, no lines, no diagnostics, nothing at all. Mark

Mark Burton wrote:
Well, I looked at it but learnt nothing. I just get an empty map, no lines, no diagnostics, nothing at all.
Mark
If you zoom in I think the contours and provincial boundaries will show up, but at full zoom nothing shows because the national boundaries are missing. I am not sure exactly when they should show in mapsource, but gpsmapedit tells me they are not in the img file at all. Garvan

If you zoom in I think the contours and provincial boundaries will show up, but at full zoom nothing shows because the national boundaries are missing. I am not sure exactly when they should show in mapsource, but gpsmapedit tells me they are not in the img file at all.
OK, I think what's happening here is that the file contains a lot of points that are so close together that the remove-short-arc process just throws them away and then throws the ways away because they contain less than 2 points. If you look at the diagnostics you get lots of lines like: 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm: Way 200 (http://www.openstreetmap.org/browse/way/-2475) has consecutive nodes with the same coordinates (http://www.openstreetmap.org/?mlat=11.78333&mlon=103.63197&zoom=17) - merging node -187534 into -187526 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm: Way 200 (http://www.openstreetmap.org/browse/way/-2478) has consecutive nodes with the same coordinates (http://www.openstreetmap.org/?mlat=11.78236&mlon=103.65167&zoom=17) - merging node -187581 into -187573 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm: Way 700 (http://www.openstreetmap.org/browse/way/-2477) has consecutive nodes with the same coordinates (http://www.openstreetmap.org/?mlat=11.78327&mlon=103.34835&zoom=17) - merging node -187572 into -187564 and then later you get: 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm: Way 100 (http://www.openstreetmap.org/browse/way/-11092) has less than 2 points - deleting it 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm: Way 200 (http://www.openstreetmap.org/browse/way/-11091) has less than 2 points - deleting it 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm: Way 100 (http://www.openstreetmap.org/browse/way/-11094) has less than 2 points - deleting it Can you reduce the number of points in the ways? Mark

Mark Burton wrote:
If you zoom in I think the contours and provincial boundaries will show up, but at full zoom nothing shows because the national boundaries are missing. I am not sure exactly when they should show in mapsource, but gpsmapedit tells me they are not in the img file at all.
OK, I think what's happening here is that the file contains a lot of points that are so close together that the remove-short-arc process just throws them away and then throws the ways away because they contain less than 2 points. If you look at the diagnostics you get lots of lines like:
2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm: Way 200 (http://www.openstreetmap.org/browse/way/-2475) has consecutive nodes with the same coordinates (http://www.openstreetmap.org/?mlat=11.78333&mlon=103.63197&zoom=17) - merging node -187534 into -187526 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm: Way 200 (http://www.openstreetmap.org/browse/way/-2478) has consecutive nodes with the same coordinates (http://www.openstreetmap.org/?mlat=11.78236&mlon=103.65167&zoom=17) - merging node -187581 into -187573 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm: Way 700 (http://www.openstreetmap.org/browse/way/-2477) has consecutive nodes with the same coordinates (http://www.openstreetmap.org/?mlat=11.78327&mlon=103.34835&zoom=17) - merging node -187572 into -187564
and then later you get:
2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm: Way 100 (http://www.openstreetmap.org/browse/way/-11092) has less than 2 points - deleting it 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm: Way 200 (http://www.openstreetmap.org/browse/way/-11091) has less than 2 points - deleting it 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm: Way 100 (http://www.openstreetmap.org/browse/way/-11094) has less than 2 points - deleting it
Can you reduce the number of points in the ways?
Mark
Reducing the number of points sounds like a good idea and I have read of tools that do this. The import is from shapefiles originally, so I think I can manage this. But why do the national boundaries display correctly when I delete the contour lines? Something is wrong. The line that is being dropped is a single line with 22,668 points. Garvan

Garvan & maew wrote:
Mark Burton wrote:
If you zoom in I think the contours and provincial boundaries will show up, but at full zoom nothing shows because the national boundaries are missing. I am not sure exactly when they should show in mapsource, but gpsmapedit tells me they are not in the img file at all.
OK, I think what's happening here is that the file contains a lot of points that are so close together that the remove-short-arc process just throws them away and then throws the ways away because they contain less than 2 points. If you look at the diagnostics you get lots of lines like:
2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm: Way 200 (http://www.openstreetmap.org/browse/way/-2475) has consecutive nodes with the same coordinates (http://www.openstreetmap.org/?mlat=11.78333&mlon=103.63197&zoom=17) - merging node -187534 into -187526 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm: Way 200 (http://www.openstreetmap.org/browse/way/-2478) has consecutive nodes with the same coordinates (http://www.openstreetmap.org/?mlat=11.78236&mlon=103.65167&zoom=17) - merging node -187581 into -187573 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm: Way 700 (http://www.openstreetmap.org/browse/way/-2477) has consecutive nodes with the same coordinates (http://www.openstreetmap.org/?mlat=11.78327&mlon=103.34835&zoom=17) - merging node -187572 into -187564
and then later you get:
2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm: Way 100 (http://www.openstreetmap.org/browse/way/-11092) has less than 2 points - deleting it 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm: Way 200 (http://www.openstreetmap.org/browse/way/-11091) has less than 2 points - deleting it 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm: Way 100 (http://www.openstreetmap.org/browse/way/-11094) has less than 2 points - deleting it
Can you reduce the number of points in the ways?
Mark
Reducing the number of points sounds like a good idea and I have read of tools that do this. The import is from shapefiles originally, so I think I can manage this.
But why do the national boundaries display correctly when I delete the contour lines? Something is wrong. The line that is being dropped is a single line with 22,668 points.
Garvan
PS. Thanks for your help.

Garvan & maew wrote:
Garvan & maew wrote:
Mark Burton wrote:
If you zoom in I think the contours and provincial boundaries will show up, but at full zoom nothing shows because the national boundaries are missing. I am not sure exactly when they should show in mapsource, but gpsmapedit tells me they are not in the img file at all.
OK, I think what's happening here is that the file contains a lot of points that are so close together that the remove-short-arc process just throws them away and then throws the ways away because they contain less than 2 points. If you look at the diagnostics you get lots of lines like:
2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm: Way 200 (http://www.openstreetmap.org/browse/way/-2475) has consecutive nodes with the same coordinates (http://www.openstreetmap.org/?mlat=11.78333&mlon=103.63197&zoom=17) - merging node -187534 into -187526 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm: Way 200 (http://www.openstreetmap.org/browse/way/-2478) has consecutive nodes with the same coordinates (http://www.openstreetmap.org/?mlat=11.78236&mlon=103.65167&zoom=17) - merging node -187581 into -187573 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm: Way 700 (http://www.openstreetmap.org/browse/way/-2477) has consecutive nodes with the same coordinates (http://www.openstreetmap.org/?mlat=11.78327&mlon=103.34835&zoom=17) - merging node -187572 into -187564
and then later you get:
2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm: Way 100 (http://www.openstreetmap.org/browse/way/-11092) has less than 2 points - deleting it 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm: Way 200 (http://www.openstreetmap.org/browse/way/-11091) has less than 2 points - deleting it 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm: Way 100 (http://www.openstreetmap.org/browse/way/-11094) has less than 2 points - deleting it
Can you reduce the number of points in the ways?
Mark
Reducing the number of points sounds like a good idea and I have read of tools that do this. The import is from shapefiles originally, so I think I can manage this.
But why do the national boundaries display correctly when I delete the contour lines? Something is wrong. The line that is being dropped is a single line with 22,668 points.
Garvan
PS. Thanks for your help.
I found a generalize function in gpsmapedit that removed 10% of the points in the file, but the national boundaries still did not display, so I split the very long polyline up and then it compiled correctly. This experience may be worth noting for others who see long lines disappearing with no error message when compiling in osm format. Thanks, Garvan

Hello Garvan,
I found a generalize function in gpsmapedit that removed 10% of the points in the file, but the national boundaries still did not display, so I split the very long polyline up and then it compiled correctly.
I don't see why that was required because we already split lines that have more than 250 points.
This experience may be worth noting for others who see long lines disappearing with no error message when compiling in osm format.
Sure, but I would rather find out why the existing line splitting didn't work satisfactorily. Mark

Mark Burton wrote:
Hello Garvan,
I found a generalize function in gpsmapedit that removed 10% of the points in the file, but the national boundaries still did not display, so I split the very long polyline up and then it compiled correctly.
I don't see why that was required because we already split lines that have more than 250 points.
This experience may be worth noting for others who see long lines disappearing with no error message when compiling in osm format.
Sure, but I would rather find out why the existing line splitting didn't work satisfactorily.
Mark
I managed to isolate the problem further. The lines disappear only when you have ways where the first and last point of the way are identical. It makes no difference if I merge the first and last node or when they have separate node id's. This has allowed me to make a small file demonstrating the problem, which I have uploaded to http://dl.dropbox.com/u/4900023/cambodia.osm.gz . This file contains nine ways (contour lines) but when compiled with the option --remove-short-arcs=5 only three ways (one of which might be too small to see) are in the img file. Now that I understand the problem I can avoid it easily by pre-processing the file, but I am sure others must be relying on --remove-short-arcs with raw osm input. Garvan

Hi Garvan, Thanks for persevering with this issue. Your latest example has brought me enlightenment! I will work on a solution this evening. Mark

Hi Mark, Thanks for the patch. I first did patch -p0 instead of patch -p1 and the version of patch in Debian Squeeze (testing) surprised me by saying that every hunk failed, and creating an empty b/src/... directory with .orig and .rej files.
The good news is that this should now no longer falsely complain about a flare road being the wrong direction when that flare road pair are the only roads connected to a given roundabout. Right, with the same map data, I get no warning for that roundabout.
The bad news is that it will now find more bad flare roads than it did before - and you thought you had fixed them all!
The good news for me is that I only saw 3 new warnings for Finland. :-) All were legitimate, and I fixed them already. In other words, please commit the patch. Marko
participants (3)
-
Garvan & maew
-
Mark Burton
-
Marko Mäkelä