[SOLVED] Find all retirement/nursing homes within 10km radius?

Hello,

I need to find all the retirement/nursing homes within 10km from a given location.

The following OverpassTurbo query runs for ~30s before returning… nothing. What am I doing wrong?

Thank you.

[out:json][timeout:25];

(
//location 123
rel(123);
)->.location;

(
node[amenity~"(retirement_home|nursing_home)"];
)->.items;

(
node.items(around.location:10);
)->.ItemsNearLocation;

.ItemsNearLocation;

out center;

Edit: This works:

[out:json][timeout:25];

[amenity~"(retirement_home|nursing_home)"](around:5000, LAT, LON);

out center;

Try increasing your timeout from 25 seconds to 90 / 120 & see if that helps?

Yes, thank you.

1 Like

I think you need more work on this. The recommended tagging as per the wiki is amenity=social_facility with social_facility=nursing_home. Also you would need to change the “around” from 5000 to 10000 as your post says “within 10km radius” unless I’m understanding you wrongly? And, I never use the timeout thing in any queries!

1 Like
[out:json];
//[out:csv("name","addr:street","addr:city","addr:postcode","website","phone")];
(
  nwr(around:10000,52.921820,-1.476792)["social_facility"="nursing_home"];
  nwr(around:10000,52.921820,-1.476792)["amenity"="nursing_home"];
  nwr(around:10000,52.921820,-1.476792)["social_facility"="care_home"];
  nwr(around:10000,52.921820,-1.476792)["amenity"="care_home"];
);
(._;>;);
out qt;

This will should find most of them within a 10km radius of Derby city centre, even the ones that have non-standard tagging, and display them on the map. Just change the lat,lon to wherever. The second line is commented out but that would output as text ready to copy and paste into a spreadsheet.

1 Like

Thanks.

Simplified with regexes:

[out:json];

(
  nw(around:5000,LAT, LON)["social_facility"~"(nursing_home|care_home)"];
  nw(around:5000,LAT, LON)["amenity"~"(nursing_home|care_home)"];
);

(._;>;);
out qt;
1 Like

[/quote]

Hi, a more simple version for your reference.
You can take a look at this code that I use for equine-assisted centers and adjust to 10 km. It finds the center of the slippy map without having to enter in a specific lat/lon.

Thanks for the tip.

For some reason, it returns nothing, though:

[out:json][timeout:25];

// the center macro will determine the map's center as shown.
nw(around:5000, {{center}})["social_facility"~"(nursing_home|care_home)"];
nw(around:5000, {{center}})["amenity"~"(nursing_home|care_home)"];

out geom;

1 Like

Hi,

You’ll need to include multiple queries inside parentheses. Then it should fire for you. See how I added them here.