From aa4bd006312e6a0acbd728dec9daa4f745741390 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sat, 23 May 2020 16:19:27 +0200 Subject: [PATCH] Adapt boundary labels for Sweden and Norway This also gives us the correct labels for address output in json and xml. --- lib/ClassTypes.php | 10 +++++++++- test/php/Nominatim/ClassTypesTest.php | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/ClassTypes.php b/lib/ClassTypes.php index 5a69d1de..4077d211 100644 --- a/lib/ClassTypes.php +++ b/lib/ClassTypes.php @@ -85,7 +85,15 @@ function getBoundaryLabel($iAdminLevel, $sCountry, $sFallback = 'Administrative' 9 => 'City District', 10 => 'Suburb', 11 => 'Neighbourhood' - ) + ), + 'no' => array ( + 3 => 'State', + 4 => 'County' + ), + 'se' => array ( + 3 => 'State', + 4 => 'County' + ) ); if (isset($aBoundaryList[$sCountry]) diff --git a/test/php/Nominatim/ClassTypesTest.php b/test/php/Nominatim/ClassTypesTest.php index 324acdde..1ba79bdb 100644 --- a/test/php/Nominatim/ClassTypesTest.php +++ b/test/php/Nominatim/ClassTypesTest.php @@ -61,6 +61,8 @@ class ClassTypesTest extends \PHPUnit\Framework\TestCase $this->assertEquals('Administrative', ClassTypes\getBoundaryLabel(18, null)); $this->assertEquals('None', ClassTypes\getBoundaryLabel(18, null, 'None')); $this->assertEquals('State', ClassTypes\getBoundaryLabel(4, 'de', 'None')); + $this->assertEquals('County', ClassTypes\getBoundaryLabel(4, 'se', 'None')); + $this->assertEquals('Municipality', ClassTypes\getBoundaryLabel(7, 'se', 'None')); } public function testGetDefRadius() -- 2.39.5