NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum



Using overpass Turbo I'd like to find all parks in the current display that have leisure=playground mapped as polygons or POIs within the polygon of the park. I'm sorry I have no code worthy of posting, but I assume I would need to first. pass the parks to a variable & then somehow iterate through them to find if the playgrounds are within.

Would foreach need to be used or is there a simpler method?

I'm not expecting a fully form query, but any pointers in the right directions would be appreciated.

asked 17 Jan '16, 14:58

DaveF's gravatar image

accept rate: 16%

edited 17 Jan '16, 19:37

aseerel4c26's gravatar image

aseerel4c26 ♦

Right, this will not work with arbitrary polygons as of today, or to be more precise, there has to be a matching area created beforehand on the server, subject to specific area creation rules. Those rules usually require a name tag to be present on the respective polygon. If that's case you can use the following official approach:

overpass turbo link:

In cases, where no matching area exists, there's the following option, currently available as a preview version:

overpass turbo link:

This query will return those leisure=playground ways/nodes, which are inside a leisure=park way. Please give it a try. It may be a bit slow, as the dev box runs on somewhat slow hard disks and not SSDs as on production.

Please note that this feature is not available on the official instance on Furthermore, it currently has some rough edges and still needs to be reviewed by Roland. Hopefully, we will see this fully functional on some time in 2016... Stay tuned.

Want to find out more? Take a look at the Github page for lots of further examples and screenshots:

permanent link

answered 18 Jan '16, 11:39

mmd's gravatar image

accept rate: 37%

edited 19 Jan '16, 15:45

Many thanks for your replies. They are close to what I desire except I'd like the parks to be returned not the playgrounds. Is this possible with a small tweak?

(19 Jan '16, 15:13) DaveF

I revised my answer to return the parks instead (this works only in case they have a name=* tag).

If that answers your question, would you mind accepting it? Thanks.

(19 Jan '16, 15:44) mmd

Thank you - Accepted. Lots for me to learn. I've never heard of map_to_area or pivot.

(20 Jan '16, 12:02) DaveF

Thanks. I used map_to_area as a workaround to get only areas in a certain bounding box. map_to_area will simply add 2400000000 to the way's id. So if you query for a way, then call map_to_area, you'll end up with the respective area (assuming it exists in the first place).

(22 Jan '16, 08:53) mmd

Here's a query that finds playgrounds that are merely nearby the boundaries of parks:

Not perfect, but probably sufficient for many uses.

I'm not aware that there is a way to check inside of arbitrary geometries. The 'is_in' operator deals with areas, but only a subset of OSM areas are available, parks are not one of them.

permanent link

answered 17 Jan '16, 15:31

maxerickson's gravatar image

accept rate: 32%

edited 17 Jan '16, 15:37

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 17 Jan '16, 14:58

question was seen: 7,375 times

last updated: 22 Jan '16, 08:53

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum