"city": "London",
"state_district": "Greater London",
"state": "England",
- "state-ISO3166-2": "GB-ENG",
+ "ISO3166-2-lvl4": "GB-ENG",
"postcode": "SW1A 2DU",
"country": "United Kingdom",
"country_code": "gb"
</result>
<addressparts>
<state>Bavaria</state>
- <state-ISO3166-2>DE-BY</state_code>
+ <ISO3166-2-lvl4>DE-BY</state_code>
<country>Germany</country>
<country_code>de</country_code>
</addressparts>
<city>London</city>
<state_district>Greater London</state_district>
<state>England</state>
- <state-ISO3166-2>GB-ENG</state_code>
+ <ISO3166-2-lvl4>GB-ENG</state_code>
<postcode>SW1A 2DU</postcode>
<country>United Kingdom</country>
<country_code>gb</country_code>
* continent
* country, country_code
- * region, state, state-ISO3166-2, state_district, county, county-ISO3166-2
+ * region, state, state_district, county, ISO3166-2-lvl<admin_level>
* municipality, city, town, village
* city_district, district, borough, suburb, subdivision
* hamlet, croft, isolated_dwelling
$aAddress[$sTypeLabel] = $sName;
if (!empty($aLine['name'])) {
- $this->addSubdivisionCode($aAddress, $sTypeLabel, $aLine['name']);
+ $this->addSubdivisionCode($aAddress, $aLine['admin_level'], $aLine['name']);
}
}
}
return $this->aAddressLines;
}
- private function addSubdivisionCode(&$aAddress, $sTypeLabel, $nameDetails)
+ private function addSubdivisionCode(&$aAddress, $iAdminLevel, $nameDetails)
{
if (is_string($nameDetails)) {
$nameDetails = json_decode('{' . str_replace('"=>"', '":"', $nameDetails) . '}', true);
}
if (!empty($nameDetails['ISO3166-2'])) {
- $aAddress["$sTypeLabel-ISO3166-2"] = $nameDetails['ISO3166-2'];
+ $aAddress["ISO3166-2-lvl$iAdminLevel"] = $nameDetails['ISO3166-2'];
}
}
}
| postcode | 9495 |
| country | Liechtenstein |
| country_code | li |
+ | ISO3166-2-lvl12 | LI-09 |
Examples:
| format |
| postcode | 9497 |
| country | Liechtenstein |
| country_code | li |
+ | ISO3166-2-lvl10 | LI-10 |
Scenario: House number interpolation
When sending json search query "Grosssteg 1023, Triesenberg" with address
| town | Triesenberg |
| country | Liechtenstein |
| country_code | li |
+ | ISO3166-2-lvl10 | LI-10 |
Scenario Outline: Housenumber 0 can be found
When sending <format> search query "Gnalpstrasse 0" with address
'city' => 'London',
'state_district' => 'Greater London',
'state' => 'England',
- 'state-ISO3166-2' => 'GB-ENG',
+ 'ISO3166-2-lvl4' => 'GB-ENG',
+ 'ISO3166-2-lvl6' => 'GB-LND',
'postcode' => 'SW1A 2AA',
'country' => 'United Kingdom',
'country_code' => 'gb'
{"place_id":193774423,
"osm_type":"R",
"osm_id":65606,
- "name":{"name": "London", "name:be": "Лондан", "name:ca": "Londres", "name:el": "Λονδίνο", "name:en": "London", "name:eo": "Londono", "name:es": "Londres", "name:fa": "لندن", "name:fi": "Lontoo", "name:fr": "Londres", "name:fy": "Londen", "name:gl": "Londres", "name:hi": "लंदन", "name:lt": "Londonas", "name:nl": "Londen", "name:pl": "Londyn", "name:pt": "Londres", "name:ru": "Лондон", "name:uk": "Лондон", "name:vi": "Luân Đôn", "name:zh": "伦敦", "int_name": "London", "name:szl": "Lůndůn", "name:tzl": "Londra", "name:be-tarask": "Лёндан"},
+ "name":{"name": "London", "ISO3166-2": "GB-LND", "name:be": "Лондан", "name:ca": "Londres", "name:el": "Λονδίνο", "name:en": "London", "name:eo": "Londono", "name:es": "Londres", "name:fa": "لندن", "name:fi": "Lontoo", "name:fr": "Londres", "name:fy": "Londen", "name:gl": "Londres", "name:hi": "लंदन", "name:lt": "Londonas", "name:nl": "Londen", "name:pl": "Londyn", "name:pt": "Londres", "name:ru": "Лондон", "name:uk": "Лондон", "name:vi": "Luân Đôn", "name:zh": "伦敦", "int_name": "London", "name:szl": "Lůndůn", "name:tzl": "Londra", "name:be-tarask": "Лёндан"},
"class":"place",
"type":"city",
"admin_level":6,