From ef4751542068c58017d1b9ce430af2f7afed3c81 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 10 Apr 2020 22:56:55 +0200 Subject: [PATCH] make admin levels 3 and 7 distinct ones in addresses There really is no need to conflate these two levels as they are in use in various countries. Also adds province as a distinct place. Fixes #1736. --- lib/ClassTypes.php | 5 +++-- test/php/Nominatim/ClassTypesTest.php | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/ClassTypes.php b/lib/ClassTypes.php index 91066a1f..60f18d95 100644 --- a/lib/ClassTypes.php +++ b/lib/ClassTypes.php @@ -79,12 +79,13 @@ function getList() 'boundary:administrative:1' => array('label' => 'Continent', 'frequency' => 0, 'icon' => 'poi_boundary_administrative', 'defdiameter' => 0.32), 'boundary:administrative:2' => array('label' => 'Country', 'frequency' => 0, 'icon' => 'poi_boundary_administrative', 'defdiameter' => 0.32), 'place:country' => array('label' => 'Country', 'frequency' => 0, 'icon' => 'poi_boundary_administrative', 'defzoom' => 6, 'defdiameter' => 15), - 'boundary:administrative:3' => array('label' => 'State', 'frequency' => 0, 'icon' => 'poi_boundary_administrative', 'defdiameter' => 0.32), + 'boundary:administrative:3' => array('label' => 'Region', 'frequency' => 0, 'icon' => 'poi_boundary_administrative', 'defdiameter' => 0.32), 'boundary:administrative:4' => array('label' => 'State', 'frequency' => 0, 'icon' => 'poi_boundary_administrative', 'defdiameter' => 0.32), 'place:state' => array('label' => 'State', 'frequency' => 0, 'icon' => 'poi_boundary_administrative', 'defzoom' => 8, 'defdiameter' => 5.12), + 'place:province' => array('label' => 'Province', 'frequency' => 0, 'icon' => 'poi_boundary_administrative', 'defzoom' => 8, 'defdiameter' => 5.12), 'boundary:administrative:5' => array('label' => 'State District', 'frequency' => 0, 'icon' => 'poi_boundary_administrative', 'defdiameter' => 0.32), 'boundary:administrative:6' => array('label' => 'County', 'frequency' => 0, 'icon' => 'poi_boundary_administrative', 'defdiameter' => 0.32), - 'boundary:administrative:7' => array('label' => 'County', 'frequency' => 0, 'icon' => 'poi_boundary_administrative', 'defdiameter' => 0.32), + 'boundary:administrative:7' => array('label' => 'Municipality', 'frequency' => 0, 'icon' => 'poi_boundary_administrative', 'defdiameter' => 0.32), 'place:county' => array('label' => 'County', 'frequency' => 108, 'icon' => 'poi_boundary_administrative', 'defzoom' => 10, 'defdiameter' => 1.28), 'boundary:administrative:8' => array('label' => 'City', 'frequency' => 0, 'icon' => 'poi_boundary_administrative', 'defdiameter' => 0.32), 'place:city' => array('label' => 'City', 'frequency' => 66, 'icon' => 'poi_place_city', 'defzoom' => 12, 'defdiameter' => 0.32), diff --git a/test/php/Nominatim/ClassTypesTest.php b/test/php/Nominatim/ClassTypesTest.php index 8d8481f5..cec3b82a 100644 --- a/test/php/Nominatim/ClassTypesTest.php +++ b/test/php/Nominatim/ClassTypesTest.php @@ -18,9 +18,9 @@ class ClassTypesTest extends \PHPUnit\Framework\TestCase 'rank_address' => 14 ); - $this->assertEquals('County', ClassTypes\getInfo($aPlace)['label']); - $this->assertEquals('County', ClassTypes\getFallbackInfo($aPlace)['label']); - $this->assertEquals('County', ClassTypes\getProperty($aPlace, 'label')); + $this->assertEquals('Municipality', ClassTypes\getInfo($aPlace)['label']); + $this->assertEquals('Municipality', ClassTypes\getFallbackInfo($aPlace)['label']); + $this->assertEquals('Municipality', ClassTypes\getProperty($aPlace, 'label')); // 2) No admin level // Eiffel Tower -- 2.39.5