Merge pull request #1804 from lonvia/ranking-improvement-germany

Localized ranking adaptions for Germany, Sweden and Norway
This commit is contained in:
Sarah Hoffmann
2020-05-27 11:58:21 +02:00
committed by GitHub
4 changed files with 24 additions and 3 deletions

View File

@@ -85,7 +85,15 @@ function getBoundaryLabel($iAdminLevel, $sCountry, $sFallback = 'Administrative'
9 => 'City District', 9 => 'City District',
10 => 'Suburb', 10 => 'Suburb',
11 => 'Neighbourhood' 11 => 'Neighbourhood'
) ),
'no' => array (
3 => 'State',
4 => 'County'
),
'se' => array (
3 => 'State',
4 => 'County'
)
); );
if (isset($aBoundaryList[$sCountry]) if (isset($aBoundaryList[$sCountry])

View File

@@ -8,11 +8,11 @@
"province" : [8, 0], "province" : [8, 0],
"region" : [18, 0], "region" : [18, 0],
"county" : 12, "county" : 12,
"municipality" : [17, 14],
"city" : 16, "city" : 16,
"island" : [17, 0], "island" : [17, 0],
"town" : [18, 16], "town" : [18, 16],
"village" : [19, 16], "village" : [19, 16],
"municipality" : [19, 16],
"district" : [19, 16], "district" : [19, 16],
"borough" : [19, 18], "borough" : [19, 18],
"hamlet" : 20, "hamlet" : 20,
@@ -94,6 +94,7 @@
{ "countries" : [ "de" ], { "countries" : [ "de" ],
"tags" : { "tags" : {
"place" : { "place" : {
"region" : [10, 0],
"county" : [12, 0] "county" : [12, 0]
}, },
"boundary" : { "boundary" : {
@@ -107,6 +108,16 @@
"administrative7" : [14, 0] "administrative7" : [14, 0]
} }
} }
},
{ "countries" : ["se", "no"],
"tags" : {
"place" : {
},
"boundary" : {
"administrative3" : 8,
"administrative4" : 12
}
}
} }
] ]

View File

@@ -175,7 +175,7 @@ Feature: Import into placex
| N20 | 18 | 16 | | N20 | 18 | 16 |
| N21 | 19 | 16 | | N21 | 19 | 16 |
| N22 | 20 | 20 | | N22 | 20 | 20 |
| N23 | 19 | 16 | | N23 | 17 | 14 |
| N24 | 19 | 16 | | N24 | 19 | 16 |
| N26 | 19 | 18 | | N26 | 19 | 18 |
| N27 | 20 | 20 | | N27 | 20 | 20 |

View File

@@ -61,6 +61,8 @@ class ClassTypesTest extends \PHPUnit\Framework\TestCase
$this->assertEquals('Administrative', ClassTypes\getBoundaryLabel(18, null)); $this->assertEquals('Administrative', ClassTypes\getBoundaryLabel(18, null));
$this->assertEquals('None', ClassTypes\getBoundaryLabel(18, null, 'None')); $this->assertEquals('None', ClassTypes\getBoundaryLabel(18, null, 'None'));
$this->assertEquals('State', ClassTypes\getBoundaryLabel(4, 'de', '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() public function testGetDefRadius()