[OSM-dev] (Partially) duplicate ways
Joachim Zobel
jz-2008 at heute-morgen.de
Fri Aug 14 16:23:53 BST 2009
Hi.
I have searched for ways that are contained in other ways (see attached
SQL) and found 10000+ (5000+ of length > 2) in my local database
containing a post 0.6-migration map (from 2009-04) of germany. It seems
there are quite a lot of obvious inconsistencies like e.g. the ways
33816455, 33816484, 33817385, 33817396 or the ways 33309970, 33309994,
33310274, 33310413 or 33598434, 33598740.
The latest example (ways 33857470, 33857473) is from 2009-04-30. It
looks like this is not a pre-0.6 problem.
I did find the first example because they behave weird when split with
JOSM, so they are obviously harmful.
Is anybody else currently working on this topic?
Sincerely,
Joachim
-- Find ways contained in other ways
-- Attention: takes hours, even on a map of germany
SELECT wnl.id, wnr.id, COUNT(1) AS cnt
FROM current_way_nodes wnl
JOIN current_way_nodes wnr
ON wnl.node_id = wnr.node_id
AND wnl.id < wnr.id
GROUP BY wnl.id, wnr.id
HAVING COUNT(DISTINCT (wnr.sequence_id - wnl.sequence_id)) = 1
AND COUNT(1) IN (SELECT COUNT(1)
FROM current_way_nodes
WHERE id IN (wnl.id, wnr.id)
GROUP BY id)
-- AND COUNT(1) > 2
More information about the dev
mailing list