mmd
4
Under the hood, overpass turbo simply calls Nominatim, then replaces the .searchArea by whatever was returned by Nominatim (also adds some special offset value for areas). OP probably can’t include overpass turbo in their app, and needs to implement something similar.
Your query is not valid, Overpass API doesn’t support area in area queries like this one here:
area(area.a)[boundary=administrative] ->.fi;
Essentially it means, the (area.a) is being ignored, and you’re processing all areas worldwide (!).
One way to specify these filters would be:
is_in(41.8933203,12.4829321)->.all_areas;
area.all_areas[boundary=administrative][admin_level=8]->.city;
nw(area.city)[tourism=museum];
out center;
This works without querying Nominatim, but may not work depending on how admin boundaries are mapped.
BTW: I also changed amenity=museum to tourism=museum, as that’s the correct tagging for a museum (overpass turbo wizard fixed that already, see above). Also, I added ways in the result, as not every museum is mapped as a node. And finally, I returned the center point for each POI. You might want to include relations as well, ymmv.
3 Likes