GBoxSubClass
extends GBox
in package
Vérification que includes() peut être appelée avec small objet d'une sous-classe de GBox
Table of Contents
Constants
- ErrorDistanceOfEmptyGBox = 'GBox::ErrorDistanceOfEmptyGBox'
- ErrorDistOfEmptyGBox = 'GBox::ErrorDistOfEmptyGBox'
- ErrorIncorrectNbOfParams = 'BBox::ErrorIncorrectNbOfParams'
- ErrorIncorrectParams = 'BBox::ErrorIncorrectParams'
- ErrorIncorrectPosTypeInBound = 'BBox::ErrorIncorrectPosTypeInBound'
- ErrorIntersectsWithUndefBBox = 'BBox::ErrorIntersectsWithUndefBBox'
- ErrorParamInConstruct = 'GBox::ErrorParamInConstruct'
Properties
- $max : TPos
- $min : TPos
- $precision : int
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>
- asGeoJsonBbox() : array<int, float>
- renvoie un array de 4 coord [west, south, east, north] avec east < 180 conforme à la structuration dans GeoJSON
- 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
- constructTest() : void
- dist() : float
- distance la plus courte entre les position des 2 GBox, génère une exception si une des 2 BBox est vide
- distance() : float
- distance entre 2 boites, nulle ssi les 2 boites sont identiques
- distTest() : void
- distVerbose() : float
- dLat() : float|null
- dLon() : float|null
- east() : float|null
- empty() : bool
- renvoit vrai ssi la bbox est vide
- fromGeoDMd() : self
- maintien de la méthode fromGeoDMd() pour conserver la compatibilité avec le code existant
- includes() : bool
- teste si $small est strictement inclus dans $this
- includesTest() : void
- 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.
- intersectsAntiMeridian() : bool
- Teste l'intersection avec l'AM
- intersectsAntiMeridianTest() : void
- 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
- proj() : EBox
- calcule la projection d'un GBox en utilisant $proj qui doit être défini comme projection dans coordsys
- 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 degrés de longueur constante (Zoom::Size0 / 360) ou rettourne 0 si la BBox est vide
- south() : float|null
- translate360East() : static
- retourne le GBox translaté de 360° vers l'est
- translate360West() : static
- retourne le GBox translaté de 360° vers l'ouest
- union() : static
- Retourne l'union de 2 BBox
- unionVerbose() : BBox
- west() : float|null
Constants
ErrorDistanceOfEmptyGBox
public
mixed
ErrorDistanceOfEmptyGBox
= 'GBox::ErrorDistanceOfEmptyGBox'
ErrorDistOfEmptyGBox
public
mixed
ErrorDistOfEmptyGBox
= 'GBox::ErrorDistOfEmptyGBox'
ErrorIncorrectNbOfParams
public
mixed
ErrorIncorrectNbOfParams
= 'BBox::ErrorIncorrectNbOfParams'
ErrorIncorrectParams
public
mixed
ErrorIncorrectParams
= 'BBox::ErrorIncorrectParams'
ErrorIncorrectPosTypeInBound
public
mixed
ErrorIncorrectPosTypeInBound
= 'BBox::ErrorIncorrectPosTypeInBound'
ErrorIntersectsWithUndefBBox
public
mixed
ErrorIntersectsWithUndefBBox
= 'BBox::ErrorIntersectsWithUndefBBox'
ErrorParamInConstruct
public
mixed
ErrorParamInConstruct
= 'GBox::ErrorParamInConstruct'
Properties
$max read-only
public
TPos
$max
[number, number] ou [], [] ssi $min == []
$min read-only
public
TPos
$min
[number, number] ou []
$precision
public
static int
$precision
= 6
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
stringasArray()
public
asArray() : array<string, TPos>
Return values
array<string, TPos>asGeoJsonBbox()
renvoie un array de 4 coord [west, south, east, north] avec east < 180 conforme à la structuration dans GeoJSON
public
asGeoJsonBbox() : array<int, float>
Return values
array<int, float>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
TPosconstructTest()
public
static constructTest() : void
dist()
distance la plus courte entre les position des 2 GBox, génère une exception si une des 2 BBox est vide
public
dist(GBox $b2) : float
N'est pas une réelle distance entre GBox
Parameters
- $b2 : GBox
Return values
floatdistance()
distance entre 2 boites, nulle ssi les 2 boites sont identiques
public
distance(GBox $b2) : float
Parameters
- $b2 : GBox
Return values
floatdistTest()
public
static distTest() : void
distVerbose()
public
distVerbose(GBox $b2) : float
Parameters
- $b2 : GBox
Return values
floatdLat()
public
dLat() : float|null
Return values
float|nulldLon()
public
dLon() : 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
boolfromGeoDMd()
maintien de la méthode fromGeoDMd() pour conserver la compatibilité avec le code existant
public
static fromGeoDMd(TMapCatSpatial $spatial) : self
Parameters
- $spatial : TMapCatSpatial
Return values
selfincludes()
teste si $small est strictement inclus dans $this
public
includes(BBox $small[, bool $show = false ]) : bool
Parameters
- $small : BBox
- $show : bool = false
Return values
boolincludesTest()
public
static includesTest() : void
inters()
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
staticintersectsAntiMeridian()
Teste l'intersection avec l'AM
public
intersectsAntiMeridian() : bool
Return values
boolintersectsAntiMeridianTest()
public
static intersectsAntiMeridianTest() : void
intersectsTest()
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
TLLPosproj()
calcule la projection d'un GBox en utilisant $proj qui doit être défini comme projection dans coordsys
public
proj(string $proj) : EBox
Parameters
- $proj : string
Return values
EBoxround()
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 degrés de longueur constante (Zoom::Size0 / 360) ou rettourne 0 si la BBox est vide
public
size() : float
Return values
floatsouth()
public
south() : float|null
Return values
float|nulltranslate360East()
retourne le GBox translaté de 360° vers l'est
public
translate360East() : static
Return values
statictranslate360West()
retourne le GBox translaté de 360° vers l'ouest
public
translate360West() : static
Return values
staticunion()
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