Tile duplicate housenumber filtering (#1391)

This PR introduces simple filtering of duplicate housenumbers.

Simple means that filtering is done withing the tile.
Duplicates are defined as same housenumber, street, block_number[1].

Duplicates are usually caused by POIs. People like to add addresses to them. Most POIs have names so to prioritize addresses we pick features without names first.

Formula is: `row_number() OVER(PARTITION BY concat(street, block_number, housenumber) ORDER BY has_name ASC) == 1`
This commit is contained in:
ttomasz
2023-01-17 09:34:27 +01:00
committed by GitHub
parent 168e8300c0
commit 3b4650fca1
4 changed files with 33 additions and 3 deletions

View File

@@ -15,9 +15,19 @@ SELECT
osm_id,
geometry,
housenumber
FROM osm_housenumber_point
WHERE zoom_level >= 14
AND geometry && bbox;
FROM (
SELECT
osm_id,
geometry,
housenumber,
row_number() OVER(PARTITION BY concat(street, block_number, housenumber) ORDER BY has_name ASC) as rn
FROM osm_housenumber_point
WHERE 1=1
AND zoom_level >= 14
AND geometry && bbox
) t
WHERE rn = 1;
$$ LANGUAGE SQL STABLE
-- STRICT
PARALLEL SAFE;