1

I would like to find the geolocation (lat/lon) of a given full address using OverpassAPI.

[out:json];

(
  node["addr:street"="Hauptstraße"]["addr:housenumber"="1"]["addr:postcode"="4020"]["addr:city"="Linz"]["addr:country"="Austria"];
  
);
out center;

Sadly, this returns empty. But it is a full address. I wonder, how to reliably query a given full address over OverpassAPI? I would like to include everything a user provides: street, housenumber, postcode, city and country to be as unequivocal as possible.

1 Answer 1

1

Overpass API is not a geocoder.

Overpass API is designed to query OSM elements by tag. OSM elements don't necessarily have a full address given. Often, some parts of the address (country, postcode, city) are represented by administrative boundaries and similar structures instead in order not to have the same redundant information on each element.

If you want to convert an address to a geographic location, use a geocoder instead. Popular OSM-based geocoders are Nominatim and Photon.

1
  • 1
    This clears up my misunderstanding of the API. Commented Apr 17 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.