Find building by point

I have point coordinates with center of building, trying to find this building by coordinates. It works only with big radius. The search turns out to be inaccurate

[out:json][timeout:900];
        (nwr["building"](around:15, 54.336009, 48.49167)(poly:"50.7 7.1 50.7 7.12 50.71 7.11"););
        (._;>;); out meta qt;

Upvotes: 2

Views: 125

Answers (1)

mmd
mmd

Reputation: 3668

Since release 0.7.57, you can use the following query:

[out:json];
is_in(54.336009, 48.49167);
wr(pivot)[building];
out geom;

See https://dev.overpass-api.de/blog/way_based_areas.html for more details.

Note: Older versions don't support this kind of queries. Version numbers are shown in the JSON response as "generator": "Overpass API 0.7.57 ..."

Upvotes: 4

Related Questions