This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Count of Sport centres in polygons

0

Hi guys,

I am a complete newbie, any help would is highly appreciated. I am working with a shapefile of the MSOA regions in the UK and would like to get a count of all the sport centres within each of these regions.

What's the best way to approach this using Python?

Thanks

asked 07 Jun '19, 08:42

bf08's gravatar image

bf08
1111
accept rate: 0%


One Answer:

1

A simpler was would be to use QGIS. With a layer of MSOAs and a layer of sports centre centroids (example Overpass query) it is a simple Point in Polygon query. In python I would guess you will want to use something like Shapely to manipulate the data (for instance as discussed in this old blog post).

One important caveat is that leisure=sports_centre in OSM is often not equivalent to a council or privately run sports or leisure centre in ordinary UK parlance (i.e., offering a range of sports). It is often used with any sports related facility such as a private rugby club or a tennis centre.

answered 07 Jun '19, 14:00

SK53's gravatar image

SK53 ♦
28.1k48268433
accept rate: 22%

Source code available on GitHub .