From 7d30dbebc569d2626bc590c2a8624184446c2815 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 3 Apr 2023 09:17:50 +0200 Subject: [PATCH] flex style: reinstate postcode boundaries Postcode boundaries don't have a name, so need to be imported unconditionally. --- settings/import-address.lua | 2 +- settings/import-extratags.lua | 2 +- settings/import-full.lua | 2 +- settings/import-street.lua | 3 ++- test/bdd/osm2pgsql/import/tags.feature | 13 +++++++++++++ 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/settings/import-address.lua b/settings/import-address.lua index 46ab3421..43248b02 100644 --- a/settings/import-address.lua +++ b/settings/import-address.lua @@ -17,7 +17,7 @@ flex.set_main_tags{ secondary_link = 'named', tertiary_link = 'named'}, boundary = {administrative = 'named', - postal_code = 'named'}, + postal_code = 'always'}, landuse = 'fallback', place = 'always' } diff --git a/settings/import-extratags.lua b/settings/import-extratags.lua index 5feed1be..fd9a15f3 100644 --- a/settings/import-extratags.lua +++ b/settings/import-extratags.lua @@ -27,7 +27,7 @@ flex.set_main_tags{ man_made = 'always', aerialway = 'always', boundary = {'named', - postal_code = 'named'}, + postal_code = 'always'}, aeroway = 'always', amenity = 'always', club = 'always', diff --git a/settings/import-full.lua b/settings/import-full.lua index d778d5d4..1b64124d 100644 --- a/settings/import-full.lua +++ b/settings/import-full.lua @@ -27,7 +27,7 @@ flex.set_main_tags{ man_made = 'always', aerialway = 'always', boundary = {'named', - postal_code = 'named'}, + postal_code = 'always'}, aeroway = 'always', amenity = 'always', club = 'always', diff --git a/settings/import-street.lua b/settings/import-street.lua index 1718874d..68ad48bd 100644 --- a/settings/import-street.lua +++ b/settings/import-street.lua @@ -16,7 +16,8 @@ flex.set_main_tags{ primary_link = 'named', secondary_link = 'named', tertiary_link = 'named'}, - boundary = {administrative = 'named'}, + boundary = {administrative = 'named', + postal_code = 'always'}, landuse = 'fallback', place = 'always' } diff --git a/test/bdd/osm2pgsql/import/tags.feature b/test/bdd/osm2pgsql/import/tags.feature index c2ab736a..7958f4b3 100644 --- a/test/bdd/osm2pgsql/import/tags.feature +++ b/test/bdd/osm2pgsql/import/tags.feature @@ -101,6 +101,19 @@ Feature: Tag evaluation | N6003 | shop | - | + Scenario: Postcode areas + When loading osm data + """ + n1 x12.36853 y51.50618 + n2 x12.36853 y51.42362 + n3 x12.63666 y51.42362 + n4 x12.63666 y51.50618 + w1 Tboundary=postal_code,ref=3456 Nn1,n2,n3,n4,n1 + """ + Then place contains exactly + | object | class | type | name | + | W1 | boundary | postal_code | 'ref': '3456' | + Scenario: Main with extra When loading osm data """ -- 2.39.5