To download, convert, and import the data, then process summary statistics and compute importance scores, run:
```
-./wikipedia_import.sh
+./import_wikipedia.sh
```
---
Wikidata
To download, convert, and import the data, then process required items, run:
```
-./wikidata_import.sh
+./import_wikidata.sh
```
if ($aLine['type'] == 'postcode' || $aLine['type'] == 'postal_code') {
$aJson['postcode'] = $aLine['localname'];
- } elseif ($aLine['type'] == 'house_number') {
+ continue;
+ }
+
+ if ($aLine['type'] == 'house_number') {
$aJson['housenumber'] = $aLine['localname'];
+ continue;
}
if ($this->iPlaceID == $aLine['place_id']) {
9 => 'City District',
10 => 'Suburb',
11 => 'Neighbourhood'
- )
+ ),
+ 'no' => array (
+ 3 => 'State',
+ 4 => 'County'
+ ),
+ 'se' => array (
+ 3 => 'State',
+ 4 => 'County'
+ )
);
if (isset($aBoundaryList[$sCountry])
"province" : [8, 0],
"region" : [18, 0],
"county" : 12,
+ "municipality" : [17, 14],
"city" : 16,
"island" : [17, 0],
"town" : [18, 16],
"village" : [19, 16],
- "municipality" : [19, 16],
"district" : [19, 16],
"borough" : [19, 18],
"hamlet" : 20,
{ "countries" : [ "de" ],
"tags" : {
"place" : {
+ "region" : [10, 0],
"county" : [12, 0]
},
"boundary" : {
"administrative7" : [14, 0]
}
}
+},
+{ "countries" : ["se", "no"],
+ "tags" : {
+ "place" : {
+ },
+ "boundary" : {
+ "administrative3" : 8,
+ "administrative4" : 12
+ }
+ }
}
]
FOR location IN
SELECT placex.place_id, osm_type, osm_id, name, class, type,
- coalesce(extratags->'place', extratags->'linked_place') as place_type,
+ coalesce(extratags->'linked_place', extratags->'place') as place_type,
admin_level, fromarea, isaddress and linked_place_id is NULL as isaddress,
CASE WHEN rank_address = 11 THEN 5 ELSE rank_address END as rank_address,
distance, country_code, postcode
| N20 | 18 | 16 |
| N21 | 19 | 16 |
| N22 | 20 | 20 |
- | N23 | 19 | 16 |
+ | N23 | 17 | 14 |
| N24 | 19 | 16 |
| N26 | 19 | 18 |
| N27 | 20 | 20 |
$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()