[OSM-dev] Tool to filter out duplicate ways?
Jon Burgess
jburgess777 at googlemail.com
Sun Dec 17 14:37:46 GMT 2006
On Sun, 2006-12-17 at 13:55 +0000, Nick Whitelegg wrote:
> Has anyone written a tool (ideally in C or C++) for filtering out duplicate
> nodes, segments and ways from an .osm file? e.g. it takes in an OSM file
> containing two copies of, say, way 223 and outputs a file containing just the
> one copy.
Do you want to solve just the specific case where there are 2 nodes with
the same ID or the more general one where there are 2 nodes at the same
position with the same attributes but with different IDs? Solving the
specific case of duplicate IDs is fairly straight forward.
The duplicate detection code in osm2pgsql.c implements a solution for
the general case where the positions of nodes are duplicated with
different IDs (and likewise for segments & ways). This was needed for
finding duplicates in the Tiger data. The code would need some changes
however to regenerate the OSM data instead of SQL.
Jon
More information about the dev
mailing list