[OSM-dev] [Talk-GB] Simplifying OSM data (Was: Motorway and Railway progress)

Dean Earley dean at earlsoft.co.uk
Mon Nov 6 23:56:27 GMT 2006


Jon Burgess wrote:
> The current code relies on more than just knowing whether a node is
> present or not. It has to represent a set of closely spaced nodes from
> the input as being replaced by a single node in the output. This is
> tricky to do without storing at least one ID per node of the input. The
> only alternative I can think of is to iterate the OSM data a huge number
> of times (perhaps once per node) which isn't practical either.

I did this by having a list keyed on the position with the ID of each 
node I come across. If that "key" already exists (node in that 
position), I remove/mark it as a duplicate of the first.
This can be adjusted to varying precisions depending on requirements

I have my code to do this but it is VB code and is for removing 
duplicate node and zero length segments.

Shout of you want a copy and I'll try and comment it :)

-- 
Dean Earley, Dee (dean at earlsoft.co.uk)

irc:    irc://irc.blitzed.org/
web:    http://personal.earlsoft.co.uk
phone:  +44 (0)780 8369596




More information about the dev mailing list