From: Sarah Hoffmann Date: Sat, 23 May 2020 14:19:27 +0000 (+0200) Subject: Adapt boundary labels for Sweden and Norway X-Git-Tag: v3.5.0~6^2~1 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/aa4bd006312e6a0acbd728dec9daa4f745741390 Adapt boundary labels for Sweden and Norway This also gives us the correct labels for address output in json and xml. --- 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()