logo separator

[mkgmap-dev] Problem with splitter

From Gerd Petermann gpetermann_muenchen at hotmail.com on Sat Mar 17 18:31:33 GMT 2012

Hi Richard,

> Date: Sat, 17 Mar 2012 13:43:17 -0400
> From: rhansen at bbn.com
> To: mkgmap-dev at lists.mkgmap.org.uk
> Subject: Re: [mkgmap-dev] Problem with splitter
> On 2012-03-15 03:51, GerdP wrote:
> > Hi Wolfgang,
> >
> > I've described splitters algorithm as it is now here:
> > http://gis.19327.n5.nabble.com/Problem-with-splitter-tp5555886p5561551.html
> >
> > I am now working on a first approach that looks like this:
> > pass 1: calculate tile areas
> > pass 2:
> > a) for each coord, way: find out all tiles that are "touched", save the info
> > in a map
> What is the definition of "touched"?

A point normally lies in exactly one tile. Nevertheless a point can be written to more 
tiles because of the overlap handling. With "touched" I mean the point is contained in the
bounding box of the tile with its overlap.

 If a tile's extended bounding box is completely enclosed by an area, 
> does that way "touch" the tile?  What if the way was a closed polyline 
> instead of an area?
> ASCII art illustration, where 'o' is a node, the outer box is a way 
> (either area or closed polyline), and the inner box is a tile's extended 
> bounding box:
>      o-----------o
>      |  _______  |
>      | |       | |
>      | |       | |
>      | |_______| |
>      o-----------o
> > b) for each relation, find out all tiles that are "touched", and add this
> > information to the way map
> > (so that each way belonging to a relation will be written to all tiles that
> > is touched by the relation)
> Same question:  What does it mean for a relation to touch a tile?

This is something I want to find out with this discussion. Splitter r200 simply does this:
If a way has at least one point in a tile, then the way is written to that tile.
If a relation has at least one point or a way that is written to a tile, then the relation 
is also written to that tile.
I think a correct solution should additionally write the relation to all tiles that are fully 
enclosed. If a relation has sub-relations, it should also be written to all tiles that the 
sub-relation was written to.
Just to clarify: Writing a relation means writing the id, all tags, and the ids of the 

> > pass 3: for each node of each way: add the info from the way map to the
> > coords map
> > (so that each coord belonging to a way will be written to all tiles that is
> > touched by the way)
> > pass 4: for each node, way, and relation: write to the output files
> Suppose I feed all of North America to splitter.  Wouldn't this 
> algorithm write all of the nodes, ways, and relations that compose the 
> United States administrative boundary to every tile in the US?

Yes, without a clever filter algorithm this could be the case. I still hope that
we can find an algorithm that writes all that is needed, but not more. 
With needed I mean all information that mkgmap needs to correctly handle the ways and relations.
See also Wolfgangs suggestions:


I personally also don't like the idea of inventing points or ways, so I'd prefer a 

solution that simply doesn't write what isn't needed.


> -Richard
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20120317/4813bb11/attachment.html 

More information about the mkgmap-dev mailing list