mmd
6
Oh well, this query doesn’t work as expected: the query for way and relations doesn’t return any results, as the area has been overwritten by the “node” statement.
map_to_area;
(
node["tourism"="museum"](area);
way["tourism"="museum"](area); // <<<<<< area is no longer available -> empty result!
relation["tourism"="museum"](area); // <<<<<< area is no longer available -> empty result!
To fix this issue I’m assigning the result of map_to_area to a named inputset, and use this inputset in subsequent steps instead:
area[name="France"];
rel[name="Paris"](area);
map_to_area -> .searchArea;
(
node["tourism"="museum"](area.searchArea);
way["tourism"="museum"](area.searchArea);
rel["tourism"="museum"](area.searchArea);
);
out center;
To make the query more readable, I’m merging the node, way and relation query into a single nwr, which does exactly the same.
area[name="France"];
rel[name="Paris"](area);
map_to_area -> .searchArea;
nwr["tourism"="museum"](area.searchArea);
out center;
“out;” is a bit pointless (sic!) for ways and relations, as the query won’t return any geometry data.
As an alternative, you can choose between one of the following:
out center; to get a center point for ways/relations
out geom; or
(._;>;);out;