logo separator

[mkgmap-dev] Splitter details question

From Johann Gail johann.gail at gmx.de on Wed Jan 13 22:44:04 GMT 2010

> 1) determine where the tile boundaries lie, based on the distribution of 
> nodes in the osm file. None of these tiles will overlap.
> 2) for each node, determine which tile (or tiles) it belongs to. A node is 
> considered to belong to a tile if it falls anywhere within the tile itself 
> OR the overlap area. It's quite common for a single node to be assigned to 
> four tiles - one real tile plus three overlap areas (or to even more tiles, 
> if a tile is thinner than double the overlap).
> 3) for each way, lookup its nodes and find out what tile(s) they were assigned 
> to. Assign the way to those tile(s) too.
> 4) for each relation, find out what tile(s) its nodes and ways were assigned 
> to. Assign the relation to those tile(s) too.
>
> I realise this isn't perfect - nodes and ways that fall completely outside 
> the tile are included when they don't need to be, and nodes that fall outside 
> the overlap are excluded when we may not want them to be. 
Couldn't you ignore the overlapping region completely and insert instead 
a step 3a) After lookup the nodes of a way, add them to all touched 
tiles too.

E.g. nodes 11,12,13 assigned to tiles 1,2,3. While processing the line 
you detect, that the line belongs to tile 1,2,3 and add the line to the 
tiles. At this time you can see, that the node 12 belongs to tiles 1,2,3 
but is assigned to tile 2 only. So assign them additionally to tile 1 
and 3.
(I don't know if this is possible, or if there are readonly cache 
structures)

This should not increase resources much.
With this alway the complete line is included into the tiles. There will 
not be missing nodes.

> There are also 
> problems with ways that cross a tile without actually having any nodes contained 
> within the tile (even including the overlap). I'm not sure how much of a 
> problem these are in practice.
>   

If the line crosses an corner of a tile, it will be clipped at the 
boundaries or the other tiles. So there will be a small gap exactly in 
the corner. I have never seen such a thing and think this is 
neglectable. (On the other hand, if this gap is a piece of a motorway, 
routing will became a little unexpected)
> Any suggestions you have for improvements would be welcome.
>
> Chris
>
>
>
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> .
>
>   



More information about the mkgmap-dev mailing list