PitchDimensions
kloppy.domain.PitchDimensions
dataclass
Specifies the dimensions of a pitch.
| ATTRIBUTE | DESCRIPTION |
|---|---|
x_dim |
Limits of pitch boundaries in longitudinal direction.
TYPE:
|
y_dim |
Limits of pitch boundaries in lateral direction.
TYPE:
|
standardized |
Used to denote standardized pitch dimensions where data
is scaled along the axes independent of the actual dimensions of
the pitch. To get non-distored calculations, the
TYPE:
|
unit |
The unit in which distances are measured along the axes of the pitch.
TYPE:
|
goal_width |
Width of the goal.
TYPE:
|
goal_height |
Height of the goal.
TYPE:
|
six_yard_width |
Width of the six yard box.
TYPE:
|
six_yard_length |
Length of the six yard box.
TYPE:
|
penalty_area_width |
Width of the penalty area.
TYPE:
|
penalty_area_length |
Length of the penalty area.
TYPE:
|
circle_radius |
Radius of the center circle (in the longitudinal direction).
TYPE:
|
corner_radius |
Radius of the corner arcs.
TYPE:
|
penalty_spot_distance |
Distance from the goal line to the penalty spot.
TYPE:
|
penalty_arc_radius |
Radius of the penalty arc (in the longitudinal direction).
TYPE:
|
pitch_length |
True length of the pitch, in meters.
TYPE:
|
pitch_width |
True width of the pitch, in meters.
TYPE:
|
convert
Convert the pitch dimensions to another unit.
| PARAMETER | DESCRIPTION |
|---|---|
to_unit
|
The unit to convert to
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
PitchDimensions
|
The pitch dimensions in the target unit |
Source code in kloppy/domain/models/pitch.py
to_metric_base
Convert a point from this pitch dimensions to the IFAB pitch dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
point
|
The point to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Point
|
The point in the IFAB pitch dimensions |
Source code in kloppy/domain/models/pitch.py
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
from_metric_base
Convert a point from the IFAB pitch dimensions to this pitch dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
point
|
The point to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Point
|
The point in the regular pitch dimensions |
Source code in kloppy/domain/models/pitch.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 | |
distance_between
Calculate the distance between two points in the coordinate system.
| PARAMETER | DESCRIPTION |
|---|---|
point1
|
The first point
TYPE:
|
point2
|
The second point
TYPE:
|
unit
|
The unit to measure the distance in |
| RETURNS | DESCRIPTION |
|---|---|
float
|
The distance between the two points in the given unit |
Source code in kloppy/domain/models/pitch.py
kloppy.domain.MetricPitchDimensions
dataclass
|
Bases: PitchDimensions
The standard pitch dimensions in meters by IFAB regulations.
For national matches, the length of the pitch can be between 90 and 120 meters, and the width can be between 45 and 90 meters. For international matches, the length can be between 100 and 110 meters, and the width can be between 64 and 75 meters. All other dimensions are fixed.
See https://www.theifab.com/laws/latest/the-field-of-play.
convert
Convert the pitch dimensions to another unit.
| PARAMETER | DESCRIPTION |
|---|---|
to_unit
|
The unit to convert to
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
PitchDimensions
|
The pitch dimensions in the target unit |
Source code in kloppy/domain/models/pitch.py
to_metric_base
Convert a point from this pitch dimensions to the IFAB pitch dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
point
|
The point to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Point
|
The point in the IFAB pitch dimensions |
Source code in kloppy/domain/models/pitch.py
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
from_metric_base
Convert a point from the IFAB pitch dimensions to this pitch dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
point
|
The point to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Point
|
The point in the regular pitch dimensions |
Source code in kloppy/domain/models/pitch.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 | |
distance_between
Calculate the distance between two points in the coordinate system.
| PARAMETER | DESCRIPTION |
|---|---|
point1
|
The first point
TYPE:
|
point2
|
The second point
TYPE:
|
unit
|
The unit to measure the distance in |
| RETURNS | DESCRIPTION |
|---|---|
float
|
The distance between the two points in the given unit |
Source code in kloppy/domain/models/pitch.py
kloppy.domain.ImperialPitchDimensions
dataclass
|
Bases: PitchDimensions
The standard pitch dimensions in yards by IFAB regulations.
For national matches, the length of the pitch can be between 100 and 130 yards, and the width can be between 50 and 100 yards. For international matches, the length can be between 110 and 120 yards, and the width can be between 70 and 80 yards. All other dimensions are fixed.
See https://www.theifab.com/laws/latest/the-field-of-play.
convert
Convert the pitch dimensions to another unit.
| PARAMETER | DESCRIPTION |
|---|---|
to_unit
|
The unit to convert to
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
PitchDimensions
|
The pitch dimensions in the target unit |
Source code in kloppy/domain/models/pitch.py
to_metric_base
Convert a point from this pitch dimensions to the IFAB pitch dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
point
|
The point to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Point
|
The point in the IFAB pitch dimensions |
Source code in kloppy/domain/models/pitch.py
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
from_metric_base
Convert a point from the IFAB pitch dimensions to this pitch dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
point
|
The point to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Point
|
The point in the regular pitch dimensions |
Source code in kloppy/domain/models/pitch.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 | |
distance_between
Calculate the distance between two points in the coordinate system.
| PARAMETER | DESCRIPTION |
|---|---|
point1
|
The first point
TYPE:
|
point2
|
The second point
TYPE:
|
unit
|
The unit to measure the distance in |
| RETURNS | DESCRIPTION |
|---|---|
float
|
The distance between the two points in the given unit |
Source code in kloppy/domain/models/pitch.py
kloppy.domain.NormalizedPitchDimensions
dataclass
|
Bases: MetricPitchDimensions
The standard pitch dimensions in normalized units.
The pitch dimensions are normalized to a unit square, where the length and width of the pitch are 1. All other dimensions are scaled accordingly.
convert
Convert the pitch dimensions to another unit.
| PARAMETER | DESCRIPTION |
|---|---|
to_unit
|
The unit to convert to
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
PitchDimensions
|
The pitch dimensions in the target unit |
Source code in kloppy/domain/models/pitch.py
to_metric_base
Convert a point from this pitch dimensions to the IFAB pitch dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
point
|
The point to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Point
|
The point in the IFAB pitch dimensions |
Source code in kloppy/domain/models/pitch.py
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
from_metric_base
Convert a point from the IFAB pitch dimensions to this pitch dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
point
|
The point to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Point
|
The point in the regular pitch dimensions |
Source code in kloppy/domain/models/pitch.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 | |
distance_between
Calculate the distance between two points in the coordinate system.
| PARAMETER | DESCRIPTION |
|---|---|
point1
|
The first point
TYPE:
|
point2
|
The second point
TYPE:
|
unit
|
The unit to measure the distance in |
| RETURNS | DESCRIPTION |
|---|---|
float
|
The distance between the two points in the given unit |
Source code in kloppy/domain/models/pitch.py
kloppy.domain.OptaPitchDimensions
dataclass
|
Bases: PitchDimensions
The pitch dimensions used by Opta.
convert
Convert the pitch dimensions to another unit.
| PARAMETER | DESCRIPTION |
|---|---|
to_unit
|
The unit to convert to
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
PitchDimensions
|
The pitch dimensions in the target unit |
Source code in kloppy/domain/models/pitch.py
to_metric_base
Convert a point from this pitch dimensions to the IFAB pitch dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
point
|
The point to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Point
|
The point in the IFAB pitch dimensions |
Source code in kloppy/domain/models/pitch.py
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
from_metric_base
Convert a point from the IFAB pitch dimensions to this pitch dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
point
|
The point to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Point
|
The point in the regular pitch dimensions |
Source code in kloppy/domain/models/pitch.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 | |
distance_between
Calculate the distance between two points in the coordinate system.
| PARAMETER | DESCRIPTION |
|---|---|
point1
|
The first point
TYPE:
|
point2
|
The second point
TYPE:
|
unit
|
The unit to measure the distance in |
| RETURNS | DESCRIPTION |
|---|---|
float
|
The distance between the two points in the given unit |
Source code in kloppy/domain/models/pitch.py
kloppy.domain.WyscoutPitchDimensions
dataclass
|
Bases: PitchDimensions
The pitch dimensions used by Wyscout.
convert
Convert the pitch dimensions to another unit.
| PARAMETER | DESCRIPTION |
|---|---|
to_unit
|
The unit to convert to
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
PitchDimensions
|
The pitch dimensions in the target unit |
Source code in kloppy/domain/models/pitch.py
to_metric_base
Convert a point from this pitch dimensions to the IFAB pitch dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
point
|
The point to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Point
|
The point in the IFAB pitch dimensions |
Source code in kloppy/domain/models/pitch.py
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
from_metric_base
Convert a point from the IFAB pitch dimensions to this pitch dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
point
|
The point to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Point
|
The point in the regular pitch dimensions |
Source code in kloppy/domain/models/pitch.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 | |
distance_between
Calculate the distance between two points in the coordinate system.
| PARAMETER | DESCRIPTION |
|---|---|
point1
|
The first point
TYPE:
|
point2
|
The second point
TYPE:
|
unit
|
The unit to measure the distance in |
| RETURNS | DESCRIPTION |
|---|---|
float
|
The distance between the two points in the given unit |