Skip to main content

Soccer features

The features a soccer surface is drawn from (sportypy._feature_classes.soccer).

BaseSoccerFeature​

An extension of the BaseFeature class for soccer features.

The following attributes are specific to soccer features only. For more information on inherited attributes, please see the BaseFeature class definition. The default values are provided to ensure that the feature can at least be created.

Attributes​

  • pitch_length (float): The length of the pitch in TV view. The default is 0.0
  • pitch_width (float): The width of the pitch in TV view. The default is 0.0
  • feature_radius (float): The radius needed to draw the feature. This may not be needed for all features. The default is 0.0
  • feature_thickness (float): The thickness with which to draw the feature. This is normally given as the horizontal width of the feature in TV view, however it may be used to specify other thicknesses as needed. The default is 0.0
  • field_units (str): The units with which the feature is drawn. The default is "ft"

PitchConstraint​

The constraint around the interior edge of the pitch's boundary lines.

This confines all interior features to be constrained inside the pitch, as well as any interior plots.

HalfPitch​

One half, either the offensive or defensive half, of the pitch.

This allows each half to take on its own color and be plotted independently, but the halves may take the same color so they look symmetrical

PitchApron​

The apron of the pitch beyond the touchline and goal line.

This is to allow a more accurate representation of the pitch, as no ads are allowed within a certain distance of the exterior edge of the touchline and goal line

Touchline​

The touchline of the pitch, aka the sideline.

These are the lines that run the full length of the pitch

GoalLine​

The goal line of the pitch, aka the endlines.

These are the lines that run the full width of the pitch. The ball must completely cross the goal line to score a goal

CornerArc​

The arc in each corner of the pitch.

These are quarter-circles located where the touchline meets the goal line

HalfwayLine​

The halfway line of the pitch, aka the midfield line or center line.

This is the line that run the full width of the pitch

CenterCircle​

The center circle on the pitch.

The given radius should be to the outside of the circle.

PenaltyBox​

The penalty box.

This is usually the 16.5 m (18 yd) box, but may be parameterized

Attributes​

  • box_length (float): The length of the penalty box in TV view. This is the larger of the two boxes, and is usually 16.5 m (18 yards) from the back edge of the goal line
  • half_box_width (float): Half the width of the penalty box
  • penalty_mark_dist (float): The distance from the back edge of the goal line to the center of the penalty mark

GoalBox​

The goal box.

This is usually the 5.5 m (6 yd) box, but may be parameterized

Attributes​

  • box_length (float): The length of the goal box in TV view. This is the smaller of the two boxes, and is usually 5.5 m (6 yards) from the back edge of the goal line
  • half_box_width (float): Half the width of the goal box

CenterMark​

The center mark on the pitch.

This is where the kickoffs for each half, as well as following any goal, are taken

PenaltyMark​

The penalty mark.

This is the center point for arc of the penalty box, as well as where any penalty kick is taken

CornerDefensiveMark​

The corner defensive marks.

These are optional marks on the pitch, located 9.15 m (10 yd) from the corner of the pitch. Defenders should be beyond these marks (either more towards the goal or more towards the halfway line) during corner kicks

Attributes​

  • is_touchline (bool): Whether or not the corner defensive mark is along the touchline
  • is_goal_line (bool): Whether or not the corner defensive mark is along the goal line
  • depth (float): The depth (in any direction) of the defensive marks beyond the goal line or touchline
  • separation_from_line (float): The distance from the exterior edge of the goal line to the interior edge of the defensive mark

Goal​

The goal.

The goals located beyond each goal line.

Attributes​

  • goal_width (float): The interior distance between the goal posts
  • goal_depth (float): The depth of the goal from the back edge of the goal line