Replies: 1 comment
-
The magic happens in SQL in Example: -- https://www.openstreetmap.org/node/2469452675
select place_id from placex where osm_type='N' and osm_id=2469452675;
22706553
select get_address_by_language(22706553, -1, ARRAY['name:en']);
53, Schwanthalerstraße, Klinikviertel, Ludwigsvorstadt-Kliniken, 2, Munich, Bavaria, 80336, Germany
select get_address_by_language(22706553, -1, ARRAY['name:de']);
53, Schwanthalerstraße, Klinikviertel, Ludwigsvorstadt-Kliniken, Ludwigsvorstadt-Isarvorstadt, München, Bayern, 80336, Deutschland
select get_address_by_language(22706553, -1, ARRAY['name:es']);
53, Schwanthalerstraße, Klinikviertel, Ludwigsvorstadt-Kliniken, 2, Múnich, Baviera, 80336, Alemania
select get_addressdata(22706553, -1);
(113712314,W,37665695,"""name""=>""Schwanthalerstraße""",highway,secondary,,15,t,t,26,0)
(210006,N,54129121,"""name""=>""Klinikviertel""",place,quarter,,15,f,t,22,0.004454800373751082)
(13784268,N,1374687395,"""name""=>""Ludwigsvorstadt"", ""name:de""=>""Ludwigsvorstadt"", ... (290498591,R,65911,"""name""=>""Ludwigsvorstadt-Kliniken""",boundary,administrative,,10...
(290500507,R,54392,"""ref""=>""2"", ""name""=>""Ludwigsvorstadt-Isarvorstadt"", ""name:de""=>...
(290495803,R,62428,"""name""=>""München"", ""name:ar""=>""ميونخ"", ""name:az""=>""Münhen"", ... (290758640,R,2145268,"""ref""=>""BY"", ""name""=>""Bayern"", ""name:af""=>""Beiere"", ""name:a...
(290635030,R,1100784,"""ref""=>""80336""",boundary,postal_code,,15,t,f,5,0.007132745808835589)
(,,,"""name""=>""Deutschland"", ""name:ab""=>""Алмантәыла"", ""name:af""=>""Duitsland"", ""name:ak""=>""Germany"",...```
Have a look at https://github.com/OpenCageData/address-formatting/ for an alternative approach to generate an address string from a list of address parts. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I noticed that in Nominatim output, there's a
display_name
field which is usually the "address" of the map object of interest. Given that sometimes location properties (e.g. county, city, locality, street, etc.) are optional arguments, they exist for some object and not others, and we don't know when they exist and when not.Can someone point to me the code responsible for generating
display_name
field in Nominatim? I'm interested to see how it handles optional arguments and arrange different regional names into a hierarchical order.Beta Was this translation helpful? Give feedback.
All reactions