logo separator

[mkgmap-dev] Possible splitter bug

From Chris Miller chris.miller at kbcfp.com on Thu Oct 22 10:23:44 BST 2009

I've been away for a few weeks and won't have much time to work on the splitter 
for a bit longer yet but I've made a note to update the docs on the website 
to bring it in line with the latest splitter version.

As for your original query, there's a few different scenarios so let me try 
to explain each of them:

First off, when --cache isn't specified, the splitter scans through the osm 
file in an initial pass to find all the nodes so it can figure out how they 
are distributed, and hence generate the areas.list file. Because parsing 
the XML is quite slow, as an optimisation the splitter by default stops looking 
for more nodes the moment it discovers the first <way> or <relation> tag 
because it assumes the <node> tags all appear at the top of the file. If 
you happen to have an osm file where the tags are mixed in with each other 
(as is the case with your contour file) you have to specify --mixed option 
to force the splitter to keep scanning the XML right to the very end so all 
the nodes are found on this first pass. Without that, the splitter will only 
find a few nodes and end up generating a bad areas.list file, thus messing 
up the rest of the split.

When the --cache parameter is used, the splitter behaves quite differently. 
It first makes a pass through the *entire* osm file, building up a cache 
of all nodes/ways/rels (while still gathering the node information it needs 
to generate areas.list). Because the entire file is processed during the 
cache generation, it doesn't matter if the XML contains mixed nodes/ways/rels 
or not. So with --cache enabled, the --mixed parameter becomes redundant.

Similarly (and as you point out), if you use --split-file then --mixed becomes 
redundant too because the first pass isn't required.

Hopefully that explains the behaviour you're experiencing. I'll try to get 
the docs (and code) updated to make it a bit clearer what's going on.

Chris


CF> Felix Hartmann wrote:
CF> 
>> nope, you simply have not read instructions. If you include
>> contourlines you have to use --mixed parameter.
>> 
CF> I'm always eager to read instructions, but there's no mention of
CF> --mixed on the splitter instruction page at
CF> http://www.mkgmap.org.uk/page/tile-splitter
CF> 
CF> Anyway...
CF> 
CF> I've also compiled other contour maps fine without using --mixed
CF> (though in those cases I was using my own areas.list).
CF> 
CF> The --help output for splitter, on the subject of --mixed, says:
CF> "Specify this if the input osm file has nodes, ways and relations
CF> intermingled".  Should it actually say "Specify this if the input
CF> osm file has nodes, ways and relations intermingled and you are not
CF> providing your own areas definitions through the --split-file
CF> option"?
CF> 
CF> Charlie
CF> 






More information about the mkgmap-dev mailing list