
Hello Steve, all, slowly coming back from an OSM break (sorry), I had a look today at how far mkgmap and routing has come. Great work! So those mysterious TRE header bytes are just computed from the map id? An obscurity feature? I compiled branches/nod and tried creating an img with: $ java -jar mkgmap.jar --route --gmapsupp schoeneberg.osm Correct? After modifying imgfmt.app.net.RoadDef.writeNod2 to return if node==null (that's the routing node), the map compiles. It loads fine on my Etrex Vista HCx, but routing doesn't seem to work. If I try to route, it routes me along the base map (unfortunately, there's a road in the base map near here). I've traced the issue with the null routing node back to mkgmap.general.RoadNetwork.addRoad: in the cases where RoadDef.setNode isn't called, the coordList had length 0. This doesn't happen all the time, though. There's quite a few roads where coordList is non-empty and setNode does get called. Any suggestions on where to investigate further? Are these empty roads to be expected? (I've got the corresponding osm sources, but they're too big to post to the list; let me know if I should send them somewhere.) Cheers Robert

On Nov 25, 2008, at 14:20, Robert Vollmert wrote:
I've traced the issue with the null routing node back to mkgmap.general.RoadNetwork.addRoad: in the cases where RoadDef.setNode isn't called, the coordList had length 0. This doesn't happen all the time, though. There's quite a few roads where coordList is non-empty and setNode does get called.
Turns out this problem was probably caused by "deleted" ways in the osm file I saved with JOSM. It doesn't occur anymore with a fixed (and further simplified) example. Sorry. The generated map does have some problems: There's segments missing, and I can't click on a road to get info (which part of the img is responsible for this?). I ran the img through NodDisplay, and it doesn't get the start of the Tables section right. In particular, the reference coordinate is wrong. I'll try to investigate what's wrong here. Cheers Robert

On Nov 25, 2008, at 15:05, Robert Vollmert wrote:
The generated map does have some problems: There's segments missing, and I can't click on a road to get info (which part of the img is responsible for this?).
That's still the case.
I ran the img through NodDisplay, and it doesn't get the start of the Tables section right. In particular, the reference coordinate is wrong. I'll try to investigate what's wrong here.
But this was an easy bug: the size field in TableA was overflowing (patch below). TableB and TableC should probably also get int sizes. I can now route! Yay! Also, the first byte of the tables header should rather be tabC.getSizeSize() -- it's sort of the number of bytes of the Table C size field which follows Table B. "Sort of" because 0 means there's still one byte (also 0). =================================================================== --- src/uk/me/parabola/imgfmt/app/net/TableA.java (revision 720) +++ src/uk/me/parabola/imgfmt/app/net/TableA.java (working copy) @@ -27,13 +27,13 @@ private static final int ITEM_SIZE = 5; - private byte size; + private int size; private int numberOfItems; public void write(ImgFileWriter writer) { } - public byte getSize() { + public int getSize() { return size; }

Hi Robert,
slowly coming back from an OSM break (sorry), I had a look today at how far mkgmap and routing has come. Great work!
I took a bit of a break from OSM too and so there has been no work on routing in the last few months. I should say, that what works so far is very limited: anything more that a single road with two connecting roads doesn't work fully.
So those mysterious TRE header bytes are just computed from the map id? An obscurity feature?
Yes the map id and some other parts of the file.
I compiled branches/nod and tried creating an img with:
$ java -jar mkgmap.jar --route --gmapsupp schoeneberg.osm
Well, it will only work fully with .mp format files that have the node information in them, but other than that, that is correct. I'm suprised you had any success at all with a .osm file. Perhaps I made every coordinate a node, I forget.
Any suggestions on where to investigate further? Are these empty roads to be expected?
The RoadNetwork class is where everything is initially put together so that would be a good place to start.
(I've got the corresponding osm sources, but they're too big to post to the list; let me know if I should send them somewhere.)
I got them as it came to me for moderation, I would have let it through but you must have cancelled it first. Regards ..Steve
participants (2)
-
Robert Vollmert
-
Steve Ratcliffe