-
Notifications
You must be signed in to change notification settings - Fork 426
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
Nominatim (OpenStreet) city/city_district parsing of Place object #252
Comments
I've tried to get lookup data from
but I didn't get any extra data, in fact it's the same place in {
"place_id": 198709562,
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
"osm_type": "relation",
"osm_id": 3834185,
"lat": "55.76649205",
"lon": "37.5847426655174",
"display_name": "Школа №1950, 28 с1, Зоологическая улица, Кудрино, Presnensky District, Central Administrative Okrug, Moscow, Central Federal District, 123056, Russia",
"address": {
"school": "Школа №1950",
"house_number": "28 с1",
"road": "Зоологическая улица",
"suburb": "Presnensky District",
"state_district": "Central Administrative Okrug",
"state": "Moscow",
"postcode": "123056",
"country": "Russia",
"country_code": "ru"
},
"extratags": {},
"boundingbox": [
"55.7661513",
"55.7668406",
"37.5841336",
"37.585355"
]
} I've also tried with Rome:
And the result contains the city data: {
"place_id": 198986782,
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
"osm_type": "relation",
"osm_id": 5473366,
"lat": "41.9279026",
"lon": "12.5157982106648",
"display_name": "Quartiere XVII Trieste, Via Acherusio, Municipio Roma II, Rome, RM, Lazio, 00199, Italy",
"address": {
"address29": "Quartiere XVII Trieste",
"road": "Via Acherusio",
"suburb": "Municipio Roma II",
"city": "Rome",
"county": "RM",
"state": "Lazio",
"postcode": "00199",
"country": "Italy",
"country_code": "it"
},
"boundingbox": [
"41.9129308",
"41.9428268",
"12.4984614",
"12.5266728"
]
} I think it maybe a point with missing data. |
* commit 'e1eb681a94ba338bc92c4b529369c4318797186f': Added swift-package tools to 5.x Fixed never executed statment Updated podspec Bump to 4.1.0 malcommac#248 Added documentation for dataFrequency malcommac#248 Added dataFrequency filter inside the LocationRequest object malcommac#252 Parsing of the place_id for OpenStreetMap in Place object (place_id) malcommac#261 Moved sources to Sources/SwiftLocation subdirectory to be compatible with Swift Package Manager malcommac#262 Added rawData property to get the raw JSON parsed from Place when using Google/OS services. Parsed place_id of Google Maps in identifier property. malcommac#263 GeocoderRequest.Options init() is now public # Conflicts: # SwiftLocation.xcodeproj/project.pbxproj
When parsing a response from openstreetmap geocoder nominatim in a function
private func parseResultPlace(_ json: JSON) -> Place
the library is trying to access a fields
"address" -> "city", "address" -> "city_district"
that do not exist.Example request URL:
https://nominatim.openstreetmap.org/reverse?format=json&lat=55.766403&lon=37.584307&addressdetails=1&limit=1
Example response JSON:
It seems we need to send an additional request with
osm_id
to get the cityAddress lookup section in a link below:
https://wiki.openstreetmap.org/wiki/Nominatim
The text was updated successfully, but these errors were encountered: