logo separator

[mkgmap-dev] my first bugreport and try to patch

From antod05-mkgmap at yahoo.co.uk antod05-mkgmap at yahoo.co.uk on Fri Jun 5 20:08:45 BST 2009

Hi,
I just started experimenting with mkgmap and hit a bug I think. 
When I try to compile map with tdbfile and use overview-mapname option with text string 'Bulgaria' instead of 8 digit number mkgmap generate a map without complaining(?!). The detail .img file is OK, but the overview .img and .tdb files both have a problem because there is misalignment of the data.
in overview .img file(in this case Bulgaria.img):
    inner file names are not digits but the name BulgariaRGN, BulgariaLBL and so on.
in .tdb file there is an mistake. For easier explanation here is the dump from quick hacked tdb file decoder:
##### 0x42 0x25(37) Overview
map:00000000 parent:00000000 latN:0x0000781f, lonE:0x0000a014, latS:0x0000501d, lonW:0x0000e80f
txt:Overview  Map

##### 0x4c 0x9a(154) Detail
map:35900001 parent:63240000 latN:0x0094711f, lonE:0x003c9e14, latS:0x00e4531d, lonW:0x008ce80f
txt:Bulgaria OpenStreetMap (35900001)
0006 0005
15.772 3182.323 129.614 500.125 1554.196 = 5382.03125
unknown: 01c300ff 0000 00
35900001.TRE
35900001.RGN
35900001.LBL
35900001.NET
35900001.NOD

As you can see in section 0x42 the overview file has number and parent 00000000, in section 0x4c there is coded default map number 63240000.

In the applied patch I am trying to fix this behaviour by introducing new parameter overview-mapnumber to separate overview map name from the internal map number because mapsource allow to have overview and tdb file with text name not number. With hack to .img file and .tdb file(err and some crc32 calculations :-) ) i managed to start MapSource with text map name.

But the patch is not tested because as I am not java programmer, i can build  default .jar file in eclipse, but can not run it :-( it fail with this error:

$ java -Xmx1024 -jar ../../mkgmap/mkgmapz.jar -c mkgmap.cfg bulgaria.osm
SEVERE (Main): java.util.concurrent.ExecutionException: uk.me.parabola.imgfmt.ExitException: Could not open style default
java.util.concurrent.ExecutionException: uk.me.parabola.imgfmt.ExitException: Could not open style default
        at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
        at java.util.concurrent.FutureTask.get(Unknown Source)
        at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:289)
        at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:124)
        at uk.me.parabola.mkgmap.main.Main.main(Main.java:100)
Caused by:  uk.me.parabola.imgfmt.ExitException: Could not open style default
        at uk.me.parabola.mkgmap.reader.osm.xml.Osm5MapDataSource.createStyler(Osm5MapDataSource.java:129)
        at uk.me.parabola.mkgmap.reader.osm.xml.Osm5MapDataSource.load(Osm5MapDataSource.java:79)
        at uk.me.parabola.mkgmap.main.MapMaker.loadFromFile(MapMaker.java:147)
        at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:55)
        at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:168)
        at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:1)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at  java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

So how to fix the .jar file so I could build woring one and test such improvements before sending blind patches?
Could anybody test the patch and report is it working?
The expected behaviour is to have overview file Bulgaria.img with internal name 00000001 and Bulgaria.tdb with correct internal links so the project should work in MapSource.

Best Regards,
Anton Todorov


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20090605/9d5e7b90/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mkgmap.cfg
Type: application/octet-stream
Size: 6839 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20090605/9d5e7b90/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mkgmap.patch
Type: application/octet-stream
Size: 4445 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20090605/9d5e7b90/attachment-0001.obj 


More information about the mkgmap-dev mailing list