]> git.openstreetmap.org Git - nominatim.git/commitdiff
Adapt boundary labels for Sweden and Norway
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 23 May 2020 14:19:27 +0000 (16:19 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 23 May 2020 14:19:27 +0000 (16:19 +0200)
This also gives us the correct labels for address output in
json and xml.

lib/ClassTypes.php
test/php/Nominatim/ClassTypesTest.php

index 5a69d1ded8e9db631108ab9e09b9072d678d4d6a..4077d211bc94a211420838ac892cc7bcc4b6e21a 100644 (file)
@@ -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])
index 324acddecc7e1228f2e9f6b799b41642ff18c0dd..1ba79bdba282218c4aa448528a95294d27782485 100644 (file)
@@ -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()