This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

a fountain’s coordinates/node id by tag wikidata=Q…

1

sorry for the newbie question.

What would be the overpass query to get the following:

For example https://www.openstreetmap.org/node/7158766201

it should be found by solely handing over "Q83630092" and the query should return the "Location" coordinates and optionally also '7158766201'

as a collateral, we might restrict the results to amentiy "fountain" or "drinking_water" .

Any help would be highly appreciated.

asked 26 Jan '20, 09:03

ralfhauser's gravatar image

ralfhauser
26113
accept rate: 0%

edited 29 Jan '20, 10:30


One Answer:

6

Hi

This is the correct place for newbie questions.

This will return what you want:

node[amenity=fountain][wikidata=Q83630092];
out center;

https://overpass-turbo.eu/s/Q62

If you don't know if the entity was mapped as a single point, swap node for nwr (Node, Way, Relation),

If you want to search for all in area of visible screen:

[bbox:{{bbox}}];
nwr[amenity=fountain][wikidata];
out geom;

https://overpass-turbo.eu/s/Q64

You should be able to work out how to filter for drinking_water from these examples.

If you want to output as a CSV list, add [out:csv(::id, "name", "wikidata"; false; ",")] as line one.

To tie in with your other posted question - to find entities which don't have name (or wikipedia) tags add an exclamation mark:

[bbox:{{bbox}}];
nwr[amenity=fountain][wikidata][!name];
out geom;

answered 26 Jan '20, 11:19

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

edited 26 Jan '20, 11:43

Source code available on GitHub .