8000 Use numbered administrative level instead of named one by giosh94mhz · Pull Request #398 · geocoder-php/Geocoder · GitHub
[go: up one dir, main page]

Skip to content

Use numbered administrative level instead of named one #398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Feb 13, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
OpenStreetMap fix postal code and tests
  • Loading branch information
giosh94mhz committed Feb 11, 2015
commit 6ae5a6d8b7d7696ef814d316e5761c14ce2b2736
7 changes: 6 additions & 1 deletion src/Geocoder/Provider/Nominatim.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,15 @@ private function xmlResultToArray(\DOMElement $resultNode, \DOMElement $addressN
}
}

// get the first postal-code when there are many
$postalCode = current(explode(';',
$this->getNodeValue($addressNode->getElementsByTagName('postcode'))
));

$result = [
'latitude' => $resultNode->getAttribute('lat'),
'longitude' => $resultNode->getAttribute('lon'),
'postalCode' => $this->getNodeValue($addressNode->getElementsByTagName('postcode')),
'postalCode' => $postalCode,
'adminLevels' => $adminLevels,
'streetNumber' => $this->getNodeValue($addressNode->getElementsByTagName('house_number')),
'streetName' => $this->getNodeValue($addressNode->getElementsByTagName('road')) ?: $this->getNodeValue($addressNode->getElementsByTagName('pedestrian')),
Expand Down
0