phpDocumentor

Spatial extends GBox
in package

BBox en coord. géo., chaque position codée comme [lon, lat]

Par convention, on cherche à respecter: (-180 <= lon <= 180) && (-90 <= lat <= 90) sauf pour les boites à cheval sur l'anti-méridien où: (-180 <= lonmin <= 180 < lonmax <= 180+360 ) Cette convention est différente de celle utilisée par GeoJSON. Toutefois, uGeoJSON génère des bbox avec des coord. qqc, y compris lonmin < -180

Table of Contents

Constants

CONSTRAINTS  = ["les latitudes sont comprises entre -90° et 90°", "la latitude North est supérieure à la latitude South", "les longitudes West et East sont comprises entre -180° et 180° sauf dans l'exception circumnavigateTheEarth", "la longitude East est supérieure à la longitude West sauf dans l'exception astrideTheAntimeridian"]
Liste des contraintes
ErrorDistanceOfEmptyGBox  = 'GBox::ErrorDistanceOfEmptyGBox'
ErrorDistOfEmptyGBox  = 'GBox::ErrorDistOfEmptyGBox'
ErrorIncorrectNbOfParams  = 'BBox::ErrorIncorrectNbOfParams'
ErrorIncorrectParams  = 'BBox::ErrorIncorrectParams'
ErrorIncorrectPosTypeInBound  = 'BBox::ErrorIncorrectPosTypeInBound'
ErrorIntersectsWithUndefBBox  = 'BBox::ErrorIntersectsWithUndefBBox'
ErrorParamInConstruct  = 'GBox::ErrorParamInConstruct'
EXCEPTIONS  = ['astrideTheAntimeridian' => ["l'exception astrideTheAntimeridian correspond à une boite à cheval sur l'anti-méridien", "sauf dans l'exception circumnavigateTheEarth", "elle est indiquée par la valeur 'astrideTheAntimeridian' dans le champ exception", "dans ce cas East < West mais Spatial::__construct() augmente East de 360° pour que East > West"], 'circumnavigateTheEarth' => ["l'exception circumnavigateTheEarth correspond à une boite couvrant la totalité de la Terre en longitude", "elle est indiquée par la valeur 'circumnavigateTheEarth' dans le champ exception", "dans ce cas (East - West) >= 360 et -180° <= West < 180° < East < 540° (360+180)"]]
Liste des exceptions

Properties

$exception  : string|null
$max  : TPos
$min  : TPos
$precision  : int

Methods

__construct()  : mixed
ajoute au mécanisme de création de BBox la possibilité de créer une GBox à partir d'un array respectant le format Spatial défini dans MapCat et shomgt.yaml
__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
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
badLats()  : string|null
si les latitudes ne sont pas correctes alors renvoie la raison, sinon renvoie null
badLons()  : string|null
si les longitudes ne sont pas correctes alors renvoie la raison, sinon renvoie null
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
exceptionLons()  : string|null
si $this correspond à une exception alors renvoie son libellé, sinon null
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
isBad()  : string|null
si $this n'est pas correct alors renvoie la raison, sinon null
lgeoJSON()  : string
retourne le code JS génèrant l'objet L.geoJSON
ne()  : TPos
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
sw()  : TPos
test()  : void
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
layer()  : TGeoJsonFeatureCollection
génère une FeatureCollection GeoJson contenant le multiPolygone
multiPolygon()  : TGJMultiPolygon
Retourne la boite comme MultiPolygon GeoJSON avec décomposition en 2 polygones.
nw()  : TPos
ring()  : TLPos
se()  : TPos

Constants

CONSTRAINTS

Liste des contraintes

public mixed CONSTRAINTS = ["les latitudes sont comprises entre -90° et 90°", "la latitude North est supérieure à la latitude South", "les longitudes West et East sont comprises entre -180° et 180° sauf dans l'exception circumnavigateTheEarth", "la longitude East est supérieure à la longitude West sauf dans l'exception astrideTheAntimeridian"]

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'

EXCEPTIONS

Liste des exceptions

public mixed EXCEPTIONS = ['astrideTheAntimeridian' => ["l'exception astrideTheAntimeridian correspond à une boite à cheval sur l'anti-méridien", "sauf dans l'exception circumnavigateTheEarth", "elle est indiquée par la valeur 'astrideTheAntimeridian' dans le champ exception", "dans ce cas East < West mais Spatial::__construct() augmente East de 360° pour que East > West"], 'circumnavigateTheEarth' => ["l'exception circumnavigateTheEarth correspond à une boite couvrant la totalité de la Terre en longitude", "elle est indiquée par la valeur 'circumnavigateTheEarth' dans le champ exception", "dans ce cas (East - West) >= 360 et -180° <= West < 180° < East < 540° (360+180)"]]

Properties

$exception read-only

public string|null $exception

$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()

ajoute au mécanisme de création de BBox la possibilité de créer une GBox à partir d'un array respectant le format Spatial défini dans MapCat et shomgt.yaml

public __construct([string|TPos|TLPos|TLLPos|array{SW: string, NE: string, exception?: string} $param = [] ]) : mixed
Parameters
$param : string|TPos|TLPos|TLLPos|array{SW: string, NE: string, exception?: string} = []

__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

area()

public area() : float
Return values
float

asArray()

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>

badLats()

si les latitudes ne sont pas correctes alors renvoie la raison, sinon renvoie null

public badLats() : string|null
Return values
string|null

badLons()

si les longitudes ne sont pas correctes alors renvoie la raison, sinon renvoie null

public badLons() : string|null
Return values
string|null

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

constructTest()

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
float

distance()

distance entre 2 boites, nulle ssi les 2 boites sont identiques

public distance(GBox $b2) : float
Parameters
$b2 : GBox
Return values
float

distVerbose()

public distVerbose(GBox $b2) : float
Parameters
$b2 : GBox
Return values
float

dLat()

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

dLon()

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

east()

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

empty()

renvoit vrai ssi la bbox est vide

public empty() : bool
Return values
bool

exceptionLons()

si $this correspond à une exception alors renvoie son libellé, sinon null

public exceptionLons() : string|null
Return values
string|null

fromGeoDMd()

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
self

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

includesTest()

public static includesTest() : void

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

intersectsAntiMeridian()

Teste l'intersection avec l'AM

public intersectsAntiMeridian() : bool
Return values
bool

intersectsAntiMeridianTest()

public static intersectsAntiMeridianTest() : void

intersectsTest()

public static intersectsTest() : void

isBad()

si $this n'est pas correct alors renvoie la raison, sinon null

public isBad() : string|null
Return values
string|null

lgeoJSON()

retourne le code JS génèrant l'objet L.geoJSON

public lgeoJSON(array<string, string|int|float> $style, string $popupContent) : string
Parameters
$style : array<string, string|int|float>
$popupContent : string
Return values
string

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

proj()

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
EBox

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

size()

taille max en degrés de longueur constante (Zoom::Size0 / 360) ou rettourne 0 si la BBox est vide

public size() : float
Return values
float

south()

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

test()

public static test(string $cas) : void
Parameters
$cas : string

translate360East()

retourne le GBox translaté de 360° vers l'est

public translate360East() : static
Return values
static

translate360West()

retourne le GBox translaté de 360° vers l'ouest

public translate360West() : static
Return values
static

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

layer()

génère une FeatureCollection GeoJson contenant le multiPolygone

private layer(string $popupContent) : TGeoJsonFeatureCollection
Parameters
$popupContent : string
Return values
TGeoJsonFeatureCollection

multiPolygon()

Retourne la boite comme MultiPolygon GeoJSON avec décomposition en 2 polygones.

private multiPolygon() : TGJMultiPolygon

A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are clockwise, and holes are counterclockwise.

Return values
TGJMultiPolygon

ring()

private ring() : TLPos
Return values
TLPos

        
On this page

Search results