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

1
1

Hi

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

DaveF
3.3k8498133
accept rate: 16%

edited 17 Jan '16, 19:37

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554


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: http://overpass-turbo.eu/s/dQi

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

overpass turbo link: http://overpass-turbo.eu/s/dOt

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 overpass-api.de. Furthermore, it currently has some rough edges and still needs to be reviewed by Roland. Hopefully, we will see this fully functional on overpass-api.de 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: https://github.com/drolbr/Overpass-API/issues/77

permanent link

answered 18 Jan '16, 11:39

mmd's gravatar image

mmd
5.7k15388
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
1

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
1

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: http://overpass-turbo.eu/s/dNx

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

maxerickson
12.7k1083176
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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×228
×92
×65

question asked: 17 Jan '16, 14:58

question was seen: 7,631 times

last updated: 22 Jan '16, 08:53

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