In a comment on their recent diary entry publicerination suggested that use of leisure=pitch
with sport=tennis
was always intended for single tennis courts. I had my doubts given that someone in San Francisco was adding quantity
, and I have added pitch:count
and there is also a documented tag courts
. Were we just the odd mappers out?
A relatively quick way to answer this was looking at tennis courts in the UK as I have a 1-2 year old import available for Great Britain. Overpass can also be used to collect the data, but it’s not possible to calculate areas directly. I ran a query which pulled tags, the geometry and the area of each pitch in square metres and saved this first as geojson
and then as a csv
file.
I then used R to build a simple histogram of counts of pitches in binned by increments of area of 25 sq. m. A tennis court is about 250 sq. m so this should show peaks at increments of this value. I also created a cumulative version of the histogram. Note these cutoff extreme outlying values most of which have been subsequently removed by edits by Dave F.
The simple answer to the query posed by the title is NO! Only about a quarter of tennis pitches represent a single court, with at least as many objects representing 2 courts and a similar number more than 2 courts. Whereas the first peak is tight, suggesting that single courts are mapped according to the visible court markings, the second peak is much more diffuse suggesting that these are mapped to the extent of the playable area (usually a wire fence). A tiny proportion (about 100 out of 20,000) have one of the tags indicating how many courts are represented by each area.
At least in the UK, tennis courts tend to be mapped together, and the data is not suitable for counting the number of courts. It is, however, suitable for finding places to play tennis which, from a conversation with the original author of Map at the weekend, was very much an original goal (albeit swimming pools in his case).
I’m all for using OSM for this type of analytical purpose, but it is important to look at how the data is structured rather than take a pure, and often personal, view of how it should be structured.
Coda: For some reason tennis courts has always posed issues as to how to map them: single courts or in groups; the in-play area within the tramlines, or the entire playing surface, etc.
Discussion
Comment from OddBunsen on 28 April 2023 at 00:16
I thought tennis courts were mapped like these basketball courts; https://www.openstreetmap.org/edit#map=20/44.87303/-91.92920 They are within a recreation ground area bordered by a fence, and both basketball courts were mapped separately.
Comment from Lejun on 28 April 2023 at 08:02
Lacked instructions for reproducibility but interesting nonetheless! I made my own version with a somehow streamlined R code.
tl;dr: Similar results in the french Doubs’ county. Approximately 130 single courts (~ 160 m² as per standard dimensions), 260 ”double courts” (~ 2,5 the standard court dimensions) for a total of 674 items.
Comment from spughetti on 28 April 2023 at 18:02
Hey SK53!
Despite this method being common, I think it’s inaccurate and not a good use of the leisure=pitch tag.
The same goal of making it easy for people to find places to play tennis can be achieved with a leisure=sports_centre tag. Mapping a sports centre as a sport centre is more accurate than mapping it as a tennis court. Along with the leisure=sports_centre tag the courts=* and sport=* tags can be used to signify the amount of courts and sports that are available at the centre.
The wiki page states that “Pitches may be contained within a larger landuse=recreation_ground, leisure=park, leisure=sports_centre, leisure=horse_riding, a specific sports field or a leisure=sports_hall”. The “How to map” section instructs mappers to draw pitches around the outline of the pitch.
Comment from Hufkratzer on 7 May 2023 at 23:22
Overpass cannot calculate areas, but it can calculate the length of a closed way. I looked at a few dozen tennis pitches with different outline lengths and got the impression that almost all (>95%) pitches with an outline length < 115m and at least 80% of pitches with an outline length between 115m and 120m contain only one court. Check it out for yourself: https://overpass-turbo.eu/s/1uEl
Worldwide we have 347525 pitches mapped as closed ways with length < 115m, 10440 with length between 115m and 120m and 443169 in total. It follows that at least (95% * 347525 + 80% * 10440) / 443169 = 76% of all tennis pitches mapped as closed ways contain just one court. Obviously a much different result. Where does this big difference come from?
Comment from SK53 on 8 May 2023 at 16:47
@Hufkratzer : I had wondered about using this approach, and obviously can identify single courts. Interesting that on a global scale you find different results.
Initially, I wondered if there might be an effect from mapping private tennis courts, but a quick breakdown (via Geofabrik taginfo) by continent dissuaded me:
I ran your query for my local area and it found an area with 2 courts. A couple of issues: using Popular Mercator measurements make things quite different from using a geometrical accurate projection. For instance a 256 sq m court comes out at over 600 sq m at my local latitude, and a 110 m perimeter also comes out smaller, around 67 metres. Given there are differences with latitude it is only possible to do this sort of comparison for relatively small areas.
I reran the R query and plotted perimeter against area (values in Ordnance Survey projection EPSG:27700). The plot is not very elegant, but one can see the clusters of 1, 2, 3 court elements.
This is an interesting exercise in general polygon analysis and perhaps shows some of the limitations of trying to do this solely with Overpass, although to be sure I would need to repeat this with the full 400k elements.
Comment from Hufkratzer on 9 May 2023 at 00:11
https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Length says: “The length operator returns the length of the element in meters. For ways this is the length of the way.”
Are you saying that this is not correct, that I need to somehow convert the value returned by length() to meters depending on the latitude?
Comment from SK53 on 9 May 2023 at 12:30
@Hufkratzer: it looks to be so, metres in Popular Mercator varies with latitude.
I’ll put my latest data extract for GB (not current data, but an osm2pgsql database loaded last year) which includes columns for area and perimeter calculated in popular mercator, OSGB (EPSG: 27700) and the with the geography datatype in PostGIS. The latter two are very close.
Comment from Hufkratzer on 9 May 2023 at 22:21
A pitch of a given size looks larger on the map (at the same zoom level) the further it is away from the equator; two examples with perimeter ~ 110 m:
* way 1029667455 Quito, Ecuador, lat ~ 0°
* way 88871677 Northern Norway, lat ~ 70°N
But regardless of this, length() can still give the correct length in metres. Here is an explanation how it works. If it works correctly, I don’t understand why “it is only possible to do this sort of comparison for relatively small areas.”
Comment from Minh Nguyen on 14 May 2023 at 00:36
A multicourt surface is sometimes named and signposted and even addressable as if it’s a “tennis center”, but often it’s just two or four conjoined courts that happen to share some out-of-bounds space. I guess the closest analogy would be baseball diamonds, which are often arranged so that the outfields overlap significantly. Basketball courts can also be combined on a single surface, but
hoops
is already well established for that scenario.If these multi-court tennis complexes are tagged as sports centers, renderers need to be prepared for the possibility of sports centers within larger sports centers, as well as other edge cases. Plenty a YMCA features a fenced-in complex of two or four tennis courts. This actual tennis center containing a dozen courts each with spectator stands, three stadiums, and a campground would be tagged identically. This sports complex contains a tennis complex that has not been mapped because each court has been mapped individually.
Comment from SK53 on 16 May 2023 at 20:59
@Minh Nguyen: I’d avoid “out-of-bounds” space. If you have 3 courts side by side with a single surface, then if only the central court is in use effectively all of the surface is technically playable. As an example this is a crude comparison of the No. 1 Court at Wimbledon with a local group of three courts in the university (which has a number of other sites like this). As you can see the playing area of the professional show court is not much smaller than the space dedicated to three courts for leisure players. (Of course a tournament court also needs space for line judges, ball people etc).
.
Tennis is relatively unusual in this respect compared with most sports, in that the marked area does not actually delineate the allowed play area.
I’ve always found the use of the leisure=sports_centre tag to mean some place where a sport is played to be counter intuitive to my regular use of the phrase. I expect a sports centre to host facilities for multiple sports both indoor and outdoor (unfortunately UBS sold their Sportszentrum in Guggach 10 years ago, so I don’t have a nice easy non-English example). Most of the larger ones now seem to go by “sports village”, such as David Ross and Harvey Hadden local to me.
As you illustrate tagging has evolved in a way that with current semantics one can have things with the same kind of tags nesting within each other, like Matryoshka dolls.
In the UK single or small groups of tennis courts are regular features of public parks, playing fields (aka recreation grounds), school and university campuses etc. In public places they are, or were, typically close by a bowling green (as here. Sometimes they have been replaced by multi-sport pitches (often basketball & 5-a-side soccer). On school sites they may double as netball pitches in the winter, where IIRC the netball court would occupy slightly more space than a tennis court (this)one has 3 netball courts to 4 tennis courts).
What seems to have happened over the years is that as mapping became more detailed the replacement of a simple, naive(?), use of a single pitch to denote a set of contiguous courts introduced additional complications for other leisure tags too. I have no solution, and as most of my examples introduce other infelicities I’ll leave it here, but for one extra thing.
Forty years ago (give or take 6 weeks) I played tennis here. Note that this and adjacent tennis courts are mapped both individually and en masse with
leisure=pitch
.Comment from Hungerburg on 29 July 2023 at 10:17
Overpass length() seems fairly accurate. The two courts linked above output 110.079;110.175:
This slightly differs from what JOSM gives, but negligible for our purposes. Curiously, JOSM disregards projection when copy/pasting one to the place of the other - the difference is staggering.
Around here https://www.openstreetmap.org/way/678206560 maps 9 courts as a single pitch and the mapper commented the changeset “micromapping sports” ;)
PS: Beware when counting: Doubling length of the outline makes the area fit 3+ courts. 370m circumference, only three times 110, fits 9 courts and the space between.