You are not logged in.
- Topics: Active | Unanswered
Announcement
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***
#1 2021-07-22 21:35:29
- philgib
- Member
- Registered: 2021-07-22
- Posts: 3
Overpass query for swimming pools with length above 25 m ?
Hello guys,
I have been scratching my head about :
1) how to combine two criteria ( swimming pool + length>25 )
2) use the symbol >, which seems to be refused
3) what is the default unit ? cm ? inch ? foot ? meter ?
I have tried for instance :
way["leisure"="swimming_pool"]({{bbox}})[length>5]; ==> ">" is refused
Thank you
Offline
#2 2021-07-23 13:15:39
- SK53
- Member
- Registered: 2009-01-11
- Posts: 705
Re: Overpass query for swimming pools with length above 25 m ?
Various things:
* length is a tag so I don't think comparison operators are valid
* the value 5 will be treated as a string by default
* the {{bbox}} goes at the end of the filters
See this example of a similar question: https://stackoverflow.com/questions/418 … -operators
What you want is something like way["leisure"="swimming_pool"](if: t["length"]>35)({{bbox}});
Note that I'd be surprised if many pools have the length specified, and many indoor pools will just be mapped as nodes.
Offline
#3 2021-07-23 13:36:44
- philgib
- Member
- Registered: 2021-07-22
- Posts: 3
Re: Overpass query for swimming pools with length above 25 m ?
Thank you
Offline
#4 2021-07-23 13:48:49
- philgib
- Member
- Registered: 2021-07-22
- Posts: 3
Re: Overpass query for swimming pools with length above 25 m ?
I have tried the following in order to obtain all the pools of which length is > 10 meters.
/*
This has been generated by the overpass-turbo wizard.
The original search was:
“"swimming pool"”
*/
[out:json][timeout:25];
// gather results
(
// query part for: “"swimming pool"”
node["leisure"="swimming_pool"]({{bbox}});
way["leisure"="swimming_pool"](if: t["length"]>25)({{bbox}});
relation["leisure"="swimming_pool"]({{bbox}});
);
// print results
out body;
>;
out skel qt;
Out of maybe 500 existing pools known by OSM within the bbox, it highlights only 1, so something is wrong. I guess people do not enter length when creating a pool object.
Offline
#5 2021-07-23 18:58:54
- SomeoneElse
- Member
- Registered: 2010-10-13
- Posts: 1,601
Re: Overpass query for swimming pools with length above 25 m ?
As an example, there are 44 in mainland GB/IE with a length tagged: https://overpass-turbo.eu/s/19FV .
There are about 8000 in total in GB: http://taginfo.geofabrik.de/europe/grea … mming_pool and 200 in Ireland: http://taginfo.geofabrik.de/europe/irel … mming_pool .
So yes, people (in GB/IE at least) don't often tag the length.
Offline
#6 2021-07-23 19:59:31
- SK53
- Member
- Registered: 2009-01-11
- Posts: 705
Re: Overpass query for swimming pools with length above 25 m ?
If you want this type of information, I'd suggest requesting people consider adding it at the talk-gb mailing list. It's usually known locally, so fellow contributors may be able to improve this aspect of the data quickly.
Offline