phpDocumentor

BBox
in package

AbstractYes

Boite englobante en coord. géo. ou euclidiennes, chaque position codée comme [lon, lat] ou [x, y]

Cette classe est abstraite. 2 classes concrètes en héritent, l'une avec des coord. géographiques, l'autre des coord. euclidiennes Il existe une BBox particulière correspondant à un espace vide. A sa création sans paramètre la BBox est vide.

Table of Contents

Constants

ErrorIncorrectNbOfParams  = 'BBox::ErrorIncorrectNbOfParams'
ErrorIncorrectParams  = 'BBox::ErrorIncorrectParams'
ErrorIncorrectPosTypeInBound  = 'BBox::ErrorIncorrectPosTypeInBound'
ErrorIntersectsWithUndefBBox  = 'BBox::ErrorIntersectsWithUndefBBox'

Properties

$max  : TPos
$min  : TPos

Methods

__construct()  : mixed
Soit ne prend pas de paramètre et créée alors une BBox vide, soit prend en paramètre un array de 2 ou 3 nombres (Pos) interprété comme une position, soit prend en paramètre un string dont l'explode donne 2 ou 3 nombres, interprété comme une position, soit un array de 4 ou 6 nombres, soit un string dont l'explode donne 4 ou 6 nombres, interprétés comme 2 pos.
__toString()  : string
affiche la BBox en utilisant le format GeoJSON d'un Bbox avec des coord. arrondies en fonction de la $precision définie dans la classe appelée
asArray()  : array<string, TPos>
bound()  : static
retourne la BBox contenant à la fois $this et la position
center()  : TPos
retourne le centre de la BBox ou [] si elle est vide
east()  : float|null
empty()  : bool
renvoit vrai ssi la bbox est vide
includes()  : bool
teste si $small est strictement inclus dans $this
inters()  : bool
version bouléenne de intersects()
intersects()  : static
intersection de 2 bbox, si $this intersecte $b2 alors retourne le GBox/EBox d'intersection, sinon retourne null.
intersectsTest()  : void
intersectsVerbose()  : BBox|null
north()  : float|null
polygon()  : TLLPos
retourne un array d'array avec les 5 positions du polygone de la BBox ou [] si elle est vide
round()  : static
si $this est indéfini alors le renvoit sinon crée un nouvel objet de la classe appelée avec des coord. arrondies en fonction de la $precision définie dans la classe appelée
south()  : float|null
union()  : static
Retourne l'union de 2 BBox
unionVerbose()  : BBox
west()  : float|null

Constants

ErrorIncorrectNbOfParams

public mixed ErrorIncorrectNbOfParams = 'BBox::ErrorIncorrectNbOfParams'

ErrorIncorrectParams

public mixed ErrorIncorrectParams = 'BBox::ErrorIncorrectParams'

ErrorIncorrectPosTypeInBound

public mixed ErrorIncorrectPosTypeInBound = 'BBox::ErrorIncorrectPosTypeInBound'

ErrorIntersectsWithUndefBBox

public mixed ErrorIntersectsWithUndefBBox = 'BBox::ErrorIntersectsWithUndefBBox'

Properties

$max read-only

public TPos $max

[number, number] ou [], [] ssi $min == []

$min read-only

public TPos $min

[number, number] ou []

Methods

__construct()

Soit ne prend pas de paramètre et créée alors une BBox vide, soit prend en paramètre un array de 2 ou 3 nombres (Pos) interprété comme une position, soit prend en paramètre un string dont l'explode donne 2 ou 3 nombres, interprété comme une position, soit un array de 4 ou 6 nombres, soit un string dont l'explode donne 4 ou 6 nombres, interprétés comme 2 pos.

public __construct([string|TPos|TLPos|TLLPos $param = [] ]) : mixed

soit un array d'array, interprété comme une liste de positions (LPos), soit un array d'array d'array, interprété comme une liste de listes de positions (LLPos),

Parameters
$param : string|TPos|TLPos|TLLPos = []

__toString()

affiche la BBox en utilisant le format GeoJSON d'un Bbox avec des coord. arrondies en fonction de la $precision définie dans la classe appelée

public __toString() : string
Return values
string

asArray()

public asArray() : array<string, TPos>
Return values
array<string, TPos>

bound()

retourne la BBox contenant à la fois $this et la position

public bound(TPos $pos) : static
Parameters
$pos : TPos
Return values
static

center()

retourne le centre de la BBox ou [] si elle est vide

public center() : TPos
Return values
TPos

east()

public east() : float|null
Return values
float|null

empty()

renvoit vrai ssi la bbox est vide

public empty() : bool
Return values
bool

includes()

teste si $small est strictement inclus dans $this

public includes(BBox $small[, bool $show = false ]) : bool
Parameters
$small : BBox
$show : bool = false
Return values
bool

inters()

version bouléenne de intersects()

public inters(BBox $b2) : bool
Parameters
$b2 : BBox
Return values
bool

intersects()

intersection de 2 bbox, si $this intersecte $b2 alors retourne le GBox/EBox d'intersection, sinon retourne null.

public intersects(BBox $b2) : static
Parameters
$b2 : BBox
Return values
static

intersectsTest()

public static intersectsTest() : void

north()

public north() : float|null
Return values
float|null

polygon()

retourne un array d'array avec les 5 positions du polygone de la BBox ou [] si elle est vide

public polygon() : TLLPos
Return values
TLLPos

round()

si $this est indéfini alors le renvoit sinon crée un nouvel objet de la classe appelée avec des coord. arrondies en fonction de la $precision définie dans la classe appelée

public round() : static
Return values
static

south()

public south() : float|null
Return values
float|null

union()

Retourne l'union de 2 BBox

public union(BBox $b2) : static
Parameters
$b2 : BBox
Return values
static

west()

public west() : float|null
Return values
float|null

        
On this page

Search results