1

Assuming one builds a simple websearch and wants to display POIs as single markers based on the data in Openstreetmap. It is very easy to query this data with overpass when one is searching for nodes.

It is also possible though that the data is attached to ways/areas and not nodes. In that case overpass returns all the nodes and tells you which nodes make up the areas. This makes handling the response more difficult in a library like leaflet because one needs to handle those possibilities (node/area) differently. What would be sufficient for my example would just be something like the centroid of the area (read: a single node per area) though.

Is there a way to query for this in overpass or a similar service?

1 Answer 1

5

With Overpass API use out center;. See the documentation about Geometry attribute and Print (out) for more information.

Your Answer

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

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