Skip to content

Commit

Permalink
exclude inherited address on more checkes
Browse files Browse the repository at this point in the history
Fixes #42.
  • Loading branch information
lonvia committed Feb 2, 2023
1 parent 45eec19 commit ecf2016
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
9 changes: 5 additions & 4 deletions analyser/rules_specifications/addr_housenumber_no_digit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ QUERY:
type: SQLProcessor
query: >
SELECT ST_AsText(centroid) AS geometry_holder, osm_id, osm_type, address, address->'housenumber' as housenumber
FROM placex WHERE address ? 'housenumber' AND
address->'housenumber' NOT SIMILAR TO '%[[:digit:]]%' AND
lower(address->'housenumber') NOT IN ('s/n', 'sn', 'bb');
FROM placex
WHERE address ? 'housenumber' AND not address ? '_inherited'
AND address->'housenumber' NOT SIMILAR TO '%[[:digit:]]%'
AND lower(address->'housenumber') NOT IN ('s/n', 'sn', 'bb');
out:
LOOP_PROCESSING:
type: LoopDataProcessor
Expand Down Expand Up @@ -43,4 +44,4 @@ QUERY:
doc:
description: addr:housenumber without any digit in them.
why_problem: Normally house number are numbers. So, this layer tries to detect mapping mistakes by looking for house numbers that have no digits in them.
how_to_fix: Check if the house number is correct or make sense. Either fix it or delete it.
how_to_fix: Check if the house number is correct or make sense. Either fix it or delete it.
5 changes: 3 additions & 2 deletions analyser/rules_specifications/addr_place_and_street.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUERY:
type: SQLProcessor
query: >
SELECT ST_AsText(centroid) AS geometry_holder, osm_id, osm_type, address FROM placex
WHERE address ? 'place' AND address ? 'street' AND NOT address ? 'conscriptionnumber';
WHERE not address ? '_inherited'
AND address ? 'place' AND address ? 'street' AND NOT address ? 'conscriptionnumber';
out:
LOOP_PROCESSING:
type: LoopDataProcessor
Expand Down Expand Up @@ -38,4 +39,4 @@ QUERY:
doc:
description: addr:place and addr:street on the same object.
why_problem: Usually an house number refers either to a street or to a larger place. addr:place and addr:street should therefore not be used together.
how_to_fix: Set only addr:place or addr:street but not both on the same object. Usually addr:place should be changed to something like addr:suburb or addr:city.
how_to_fix: Set only addr:place or addr:street but not both on the same object. Usually addr:place should be changed to something like addr:suburb or addr:city.
3 changes: 2 additions & 1 deletion analyser/rules_specifications/addr_street_wrong_name.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ QUERY:
query: >
SELECT ST_AsText(px1.centroid) AS geometry_holder, px1.osm_id, px1.osm_type, px1.address->'street' as street_name,
px2.name->'name' as parent_name FROM (
SELECT * FROM placex WHERE rank_address=30 AND address ? 'street'
SELECT * FROM placex
WHERE rank_address=30 AND address ? 'street' AND not address ? '_inherited'
) AS px1 INNER JOIN placex AS px2
ON px1.parent_place_id = px2.place_id
WHERE px1.address->'street' not in (SELECT regexp_split_to_table(svals(px2.name), '\s*;\s*'))
Expand Down

0 comments on commit ecf2016

Please sign in to comment.