EBox
extends BBox
in package
BBox en coord. projetées euclidiennes, chaque position codée comme [x, y]
On fait l'hypothèse que la projection fait correspondre l'axe X à la direction Ouest->Est et l'axe Y à la direction Sud->Nord
Table of Contents
Constants
- ErrorDistOnEmptyEBox = 'EBox::ErrorDistOnEmptyEBox'
- ErrorIncorrectNbOfParams = 'BBox::ErrorIncorrectNbOfParams'
- ErrorIncorrectParams = 'BBox::ErrorIncorrectParams'
- ErrorIncorrectPosTypeInBound = 'BBox::ErrorIncorrectPosTypeInBound'
- ErrorIntersectsWithUndefBBox = 'BBox::ErrorIntersectsWithUndefBBox'
Properties
- $max : TPos
- $min : TPos
- $precision : int
- nbre de chiffres après la virgule à conserver pour les positions
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
- area() : float
- surface du Bbox
- 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
- covers() : float
- taux de couverture du Bbox $right par le Bbox $this
- dilate() : self
- retourne le rectangle dilaté de $dilate
- dist() : float
- distance min. entre les positions de 2 BBox, génère une erreur si une des 2 BBox est vide
- distTest() : void
- distVerbose() : float
- dx() : float|null
- dy() : float|null
- east() : float|null
- empty() : bool
- renvoit vrai ssi la bbox est vide
- geo() : GBox
- calcule les coord.géo. d'un EBox en utilisant $proj qui doit être défini comme projection dans coordsys
- 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
- size() : float
- taille max en unité ou retourne 0 si la EBox est vide
- south() : float|null
- translateInX() : self
- renvoie le rectangle translaté en X
- union() : static
- Retourne l'union de 2 BBox
- unionVerbose() : BBox
- west() : float|null
Constants
ErrorDistOnEmptyEBox
public
mixed
ErrorDistOnEmptyEBox
= 'EBox::ErrorDistOnEmptyEBox'
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 []
$precision
nbre de chiffres après la virgule à conserver pour les positions
public
static int
$precision
= 1
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
stringarea()
surface du Bbox
public
area() : float
Return values
floatasArray()
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
staticcenter()
retourne le centre de la BBox ou [] si elle est vide
public
center() : TPos
Return values
TPoscovers()
taux de couverture du Bbox $right par le Bbox $this
public
covers(EBox $right) : float
Parameters
- $right : EBox
Return values
floatdilate()
retourne le rectangle dilaté de $dilate
public
dilate(float $dilate) : self
Parameters
- $dilate : float
Return values
selfdist()
distance min. entre les positions de 2 BBox, génère une erreur si une des 2 BBox est vide
public
dist(EBox $b2) : float
Parameters
- $b2 : EBox
Return values
floatdistTest()
public
static distTest() : void
distVerbose()
public
distVerbose(EBox $b2) : float
Parameters
- $b2 : EBox
Return values
floatdx()
public
dx() : float|null
Return values
float|nulldy()
public
dy() : float|null
Return values
float|nulleast()
public
east() : float|null
Return values
float|nullempty()
renvoit vrai ssi la bbox est vide
public
empty() : bool
Return values
boolgeo()
calcule les coord.géo. d'un EBox en utilisant $proj qui doit être défini comme projection dans coordsys
public
geo(string $proj) : GBox
Parameters
- $proj : string
Return values
GBoxincludes()
teste si $small est strictement inclus dans $this
public
includes(BBox $small[, bool $show = false ]) : bool
Parameters
- $small : BBox
- $show : bool = false
Return values
boolinters()
version bouléenne de intersects()
public
inters(BBox $b2) : bool
Parameters
- $b2 : BBox
Return values
boolintersects()
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
staticintersectsTest()
public
static intersectsTest() : void
intersectsVerbose()
public
intersectsVerbose(BBox $b2) : BBox|null
Parameters
- $b2 : BBox
Return values
BBox|nullnorth()
public
north() : float|null
Return values
float|nullpolygon()
retourne un array d'array avec les 5 positions du polygone de la BBox ou [] si elle est vide
public
polygon() : TLLPos
Return values
TLLPosround()
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
staticsize()
taille max en unité ou retourne 0 si la EBox est vide
public
size() : float
Return values
floatsouth()
public
south() : float|null
Return values
float|nulltranslateInX()
renvoie le rectangle translaté en X
public
translateInX(float $dx) : self
Parameters
- $dx : float
Return values
selfunion()
Retourne l'union de 2 BBox
public
union(BBox $b2) : static
Parameters
- $b2 : BBox
Return values
staticunionVerbose()
public
unionVerbose(BBox $b2) : BBox
Parameters
- $b2 : BBox
Return values
BBoxwest()
public
west() : float|null