JoGall / soccermatics

Tools for visualisation and analysis of soccer tracking and event data
308 stars 36 forks source link

Pitch dimensions #9

Open JoGall opened 6 years ago

JoGall commented 6 years ago

Collect more pitch dimensions (length, width in metres) to pass to soccermatics functions for accurate visualisation of x,y-coordinates.

Many performance datasets (e.g. WhoScored) provide relative x,y-coordinates (e.g. a scale of 0-100), but true dimensions (i.e. in metres) are required in order to determine true distances (e.g. pass length, shot distance) and accurately visualise data on the pitch.

The file pitch_dimensions.csv contains this information, although only recent EPL teams (2016-17, 2017-18) and a few others are currently listed. These data were just grabbed manually from Wikipedia pages, with units being converted to metres where only yards were given (1 m = 1.09361 yards). The alt_name column contains alternative teamname definitions (e.g. as they appear in http://football-data.co.uk) to aid team identification.

Expanding this list if pitch dimensions would be useful so I welcome any contributions made with a pull request!

JoGall commented 6 years ago

Added soccerNormXY() function to convert arbitrary x,y-coordinates into metre units for use with soccermatics.

Users still need to provide the true pitch dimensions in metres so having a more complete reference list of stadia in pitch_dimensions.csv is still useful.

TimHoare commented 5 years ago

I've created a pull request on this for championship and la liga grounds. Most of the data was scraped from this site. I'm not 100% sure how accurate it is although most of the dimensions on there seem to be the same as those in the existing csv. The rest of the data is from transfermarkt and wikipedia. Hope this is helpful and I can do more if you need it!