
Hi The changes to read Scott Crosby's binary format are complete (for mkgmap itself) and I will merge them back soon. Before that it would be good for as many people as possible to try it out on their existing XML files, with the options that they normally use, since the code has been completely restructured. I've run a number of test that show that the results exactly the same between the new and current trunk version of mkgmap. I'm not so worried about testing the binary input, since it is new and won't affect anyone if there are bugs. It won't be that useful until splitter is able to output the format directly anyway. The amount of code required for the new format was very small once the existing code was restructured though and seem to work very well. The found actual time to read the file was cut in about half, however the time to read the input file is now a small percentage of the total run time of mkgmap, so the overall speed increase is small. The main benefit will be with the splitter and the disk space requirements. ..Steve

Hi Steve, that was a quick implementation! I haven't tried so far the new binary format. I haven't found a download for the osmprotobuf.jar. Is there any? Download links should be added to the documentation and the website if the changes are merged back. I had some thoughts if the splitter is still needed with this new format. The website of the new protocol tells me that the operation getNodesbyBoundingBox(north,south,east,west) is supported. So it should be possible to start mkgmap with the bbox definition of all tiles (like the areas.list file of the tile splitter) and a planet dump file? The splitter work could be reduced to generate a reasonable areas.list file. Are there any objections on this? Thanks for you work, Steve! WanMil
Hi
The changes to read Scott Crosby's binary format are complete (for mkgmap itself) and I will merge them back soon.
Before that it would be good for as many people as possible to try it out on their existing XML files, with the options that they normally use, since the code has been completely restructured.
I've run a number of test that show that the results exactly the same between the new and current trunk version of mkgmap.
I'm not so worried about testing the binary input, since it is new and won't affect anyone if there are bugs. It won't be that useful until splitter is able to output the format directly anyway.
The amount of code required for the new format was very small once the existing code was restructured though and seem to work very well.
The found actual time to read the file was cut in about half, however the time to read the input file is now a small percentage of the total run time of mkgmap, so the overall speed increase is small. The main benefit will be with the splitter and the disk space requirements.
..Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

On Thu, Sep 16, 2010 at 12:33 PM, WanMil <wmgcnfg@web.de> wrote:
Hi Steve,
that was a quick implementation!
I haven't tried so far the new binary format. I haven't found a download for the osmprotobuf.jar. Is there any? Download links should be added to the documentation and the website if the changes are merged back.
I am still in release candidate status as far as jar is concerned. At present, I haven't set up hosting for it anyplace. The best place to get it right now is from osmosis trunk ('osmbin.jar'), or build it from my git repository on github.
I had some thoughts if the splitter is still needed with this new format. The website of the new protocol tells me that the operation getNodesbyBoundingBox(north,south,east,west) is supported. So it should be possible to start mkgmap with the bbox definition of all tiles (like the areas.list file of the tile splitter) and a planet dump file? The splitter work could be reduced to generate a reasonable areas.list file. Are there any objections on this?
This could be done, but the data has to be geographically sorted. I've described how to do that, but the code implementing it hasn't been written. I've got a question though, why can't mkgmap generate different areas in parallel? It seems like it should be possible and it would make it a lot faster to render maps. Scott

On Thu, Sep 16, 2010 at 12:33 PM, WanMil<wmgcnfg@web.de> wrote:
Hi Steve,
that was a quick implementation!
I haven't tried so far the new binary format. I haven't found a download for the osmprotobuf.jar. Is there any? Download links should be added to the documentation and the website if the changes are merged back.
I am still in release candidate status as far as jar is concerned. At present, I haven't set up hosting for it anyplace. The best place to get it right now is from osmosis trunk ('osmbin.jar'), or build it from my git repository on github.
Thanks for the hint!
I had some thoughts if the splitter is still needed with this new format. The website of the new protocol tells me that the operation getNodesbyBoundingBox(north,south,east,west) is supported. So it should be possible to start mkgmap with the bbox definition of all tiles (like the areas.list file of the tile splitter) and a planet dump file? The splitter work could be reduced to generate a reasonable areas.list file. Are there any objections on this?
This could be done, but the data has to be geographically sorted. I've described how to do that, but the code implementing it hasn't been written.
Ok, that means we cannot use the common planet dumps for this and a separate step (geographical sorting) is needed which maybe eats up the advantage to skip the tile splitter step. Just keep the idea in mind and give it a try when the geographical sorting is available.
I've got a question though, why can't mkgmap generate different areas in parallel? It seems like it should be possible and it would make it a lot faster to render maps.
mkgmap already works in parallel if you specifiy multiple osm files which are usually generated by the tile splitter (see parameter --max-jobs). The advantage of my idea would be to skip the tile splitter step. WanMil
Scott _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Ok, that means we cannot use the common planet dumps for this and a separate step (geographical sorting) is needed which maybe eats up the advantage to skip the tile splitter step. Just keep the idea in mind and give it a try when the geographical sorting is available.
I designed the format to support that feature, but I have no idea when, or if, I'll have time to program it. One advantage is that the sorting process only has to be done once.
I've got a question though, why can't mkgmap generate different areas in parallel? It seems like it should be possible and it would make it a lot faster to render maps.
mkgmap already works in parallel if you specifiy multiple osm files which are usually generated by the tile splitter (see parameter --max-jobs). The advantage of my idea would be to skip the tile splitter step.
Are you sure? If I try it on a quad-core hyperthreading CPU, I only see about 2-3 cores used and 5 idle. (Invoked with '-c template.args and --max-jobs=10') There's also this code in MapMaker.java: /** * Load up from the file. It is not necessary for the map reader to completely * read the whole file in at once, it could pull in map-features as needed. */ private LoadableMapDataSource loadFromFile(CommandArgs args, String name) throws FileNotFoundException, FormatException { LoadableMapDataSource src; // work around non-reentrancy of GType priority stuff // by serialising the map reading synchronized(MapMaker.class) { src = MapReader.createMapReader(name); src.config(args.getProperties()); log.info("Started loading " + name); src.load(name); log.info("Finished loading " + name); } return src; }

mkgmap already works in parallel if you specifiy multiple osm files which are usually generated by the tile splitter (see parameter --max-jobs). The advantage of my idea would be to skip the tile splitter step.
Are you sure?
It is only reading the files that is serialised, the rest runs in parallel. But anyway, I am fairly sure that synchronized statement can be removed. I was never convinced there was a problem in the first place, and the alleged problem code is no longer present.
{ LoadableMapDataSource src; // work around non-reentrancy of GType priority stuff // by serialising the map reading synchronized(MapMaker.class) { src = MapReader.createMapReader(name); src.config(args.getProperties()); log.info("Started loading " + name); src.load(name); log.info("Finished loading " + name); } return src;
..Steve

On Thu, Sep 16, 2010 at 01:34:20PM -0500, Scott Crosby wrote:
I've got a question though, why can't mkgmap generate different areas in parallel? It seems like it should be possible and it would make it a lot faster to render maps.
I thought that it already does, when you specify the parameter max-jobs (it defaults to the number of processor cores). Another question that I have been asking is, why cannot mkgmap generate multiple maps (map layers) from a single map tile. Perhaps the binary format reduces the parsing overhead, but there still must be some. Here is one use case: Have several map layers built from route relations, which can be enabled or disabled on the device as needed. (When you want to see bus routes, you usually don't want to see hiking or bicycle routes and vice versa.) This would need a minor change to the style language (say, a directive identifying the layer where to generate the object) and some mapping between layer IDs in the style language and filenames on the command line. Marko

Hi
I haven't tried so far the new binary format. I haven't found a download for the osmprotobuf.jar. Is there any? Download links should be added to the documentation and the website if the changes are merged back.
Merging back can happen when I am sure that there is no harm to the XML reader. If you don't have the osmprotobuf.jar then it just won't even recognise the binary format. If you do want to try it out I have the jar files I used at http://files.mkgmap.org.uk/. I should also mention that currently the binary file must end in .bin - that will probably change. I do need to think about how to package this all up, but I won't do much until the jar file name is finalised. Until the splitter support is ready and binary downloads are available it is not going to be that useful anyway. ..Steve
participants (4)
-
Marko Mäkelä
-
Scott Crosby
-
Steve Ratcliffe
-
WanMil