Skip to main content

Match Event Y Coordinate Inversion

· 3 min read
Nick Eggleton

The AFL API provides XY coordinates of several match events, returned by a variety of endpoints such as:

When used in combination with the venue dimensions (Venue endpoint), the coordinates can be used to plot where these events occurred on a graph.

What's currently happening?​

This graph plots the launch and result locations of Q1 Inside 50 kicks at a match played at Marvel Stadium.

Inverted Y Axis

What might have caught your attention with this graph is the Y-axis - it is running positive to negative.

This is because the Y coordinates from the AFL API are inverted, so to plot the location of these kicks correctly, the Y-axis also needs inverting.

Why are the Y coordinates inverted?​

The AFL API has been providing the X and Y coordinates from the same data capture process that drives Champion Data’s older applications (such as CIS). Graphing components in these applications work intrinsically with an inverted Y-axis, so the decision was made to invert the Y coordinates when recorded so the applications plotted them correctly without redevelopment.

The AFL API meanwhile has no such requirement and has been ingesting, then delivering the same Y coordinates without change. In short, the Y coordinates retrieved from the API are still inverted.

What is being changed?​

Going forward, we want the AFL API to deliver Y coordinates so that graphs can be plotted with a negative to positive Y-axis.

Here’s the same graph as above, showing the same kicks but now with a conventional Y-axis - this graph correctly plotted the values without being specifically changed to invert its y-axis.

Normal Y Axis

When is this change happening?​

The Y coordinates will stop being inverted with the 1.27 Update (scheduled for release on the 21st of December 2023). All Y coordinate values will change by a factor of -1.

If you have already incorporated this inversion into your workflow, you will need to stop doing so once this update is released. If they weren't being inverted already, then they will now convey the correct location.

Impact

We’ve deliberately waited until the off-season period to make this change, as we’re conscious all existing applications and reports making use of this data will need adjusting.

Questions​

If you have any questions or concerns around this change, please dont hesistate to reach out to nick.eggleton@championdata.com.au