Line 17... |
Line 17... |
17 |
|
17 |
|
Line 18... |
Line 18... |
18 |
private static $listeNoeudsSelectionnes = array();
|
18 |
private static $listeNoeudsSelectionnes = array();
|
Line -... |
Line 19... |
- |
|
19 |
|
- |
|
20 |
private static $pointsDejaTraites = array();
|
19 |
|
21 |
|
20 |
private static $pointsDejaTraites = array();
|
22 |
private static $bornesMax = array('latMin' => null, 'lngMin' => null, 'latMax' => null, 'lngMax' => null);
|
21 |
|
23 |
|
22 |
/*
|
24 |
/*
|
23 |
+---------+---------+
|
25 |
+---------+---------+
|
Line 42... |
Line 44... |
42 |
$noeudRacine = array('nbrePoints' => count($markers), 'points' => $markers);
|
44 |
$noeudRacine = array('nbrePoints' => count($markers), 'points' => $markers);
|
43 |
self::attribuerAuCadran($noeudRacine, $neLat, $neLng, $swLat, $swLng);
|
45 |
self::attribuerAuCadran($noeudRacine, $neLat, $neLng, $swLat, $swLng);
|
Line 44... |
Line 46... |
44 |
|
46 |
|
45 |
} else {
|
47 |
} else {
|
- |
|
48 |
foreach($markers as $marker) {
|
46 |
foreach($markers as $marker) {
|
49 |
self::mettreAJourBornes(&$marker);
|
47 |
$points = array($marker);
|
50 |
$points = array($marker);
|
48 |
$noeudSimple = array('points' => $points, 'nbrePoints' => 1);
|
51 |
$noeudSimple = array('points' => $points, 'nbrePoints' => 1);
|
49 |
self::$nbElements['observations']++;
|
52 |
self::$nbElements['observations']++;
|
50 |
$emplacement = isset($marker['type_emplacement']) ? $marker['type_emplacement'] : self::obtenirTypeEmplacementParId(&$marker);
|
53 |
$emplacement = isset($marker['type_emplacement']) ? $marker['type_emplacement'] : self::obtenirTypeEmplacementParId(&$marker);
|
Line 87... |
Line 90... |
87 |
|
90 |
|
88 |
public static function getNbElements() {
|
91 |
public static function getNbElements() {
|
89 |
return self::$nbElements;
|
92 |
return self::$nbElements;
|
Line -... |
Line 93... |
- |
|
93 |
}
|
- |
|
94 |
|
- |
|
95 |
public static function mettreAJourBornes(&$point) {
|
- |
|
96 |
self::$bornesMax['latMin'] = (is_numeric($point['lat']) && $point['lat'] < self::$bornesMax['latMin'] || self::$bornesMax['latMin'] == null) ? $point['lat'] : self::$bornesMax['latMin'] ;
|
- |
|
97 |
self::$bornesMax['lngMin'] = (is_numeric($point['lng']) && $point['lng'] < self::$bornesMax['lngMin'] || self::$bornesMax['lngMin'] == null) ? $point['lng'] : self::$bornesMax['lngMin'] ;
|
- |
|
98 |
self::$bornesMax['latMax'] = (is_numeric($point['lat']) && $point['lat'] > self::$bornesMax['latMax'] || self::$bornesMax['latMax'] == null) ? $point['lat'] : self::$bornesMax['latMax'] ;
|
- |
|
99 |
self::$bornesMax['lngMax'] = (is_numeric($point['lng']) && $point['lng'] > self::$bornesMax['lngMax'] || self::$bornesMax['lngMax'] == null) ? $point['lng'] : self::$bornesMax['lngMax'] ;
|
- |
|
100 |
}
|
- |
|
101 |
|
- |
|
102 |
public static function getBornes() {
|
- |
|
103 |
return self::$bornesMax;
|
90 |
}
|
104 |
}
|
91 |
|
105 |
|
92 |
/**
|
106 |
/**
|
93 |
*
|
107 |
*
|
94 |
* @param mixed $noeud Le noeud à traiter par le quadtree
|
108 |
* @param mixed $noeud Le noeud à traiter par le quadtree
|
Line 102... |
Line 116... |
102 |
|
116 |
|
103 |
$latCentre = round((($neLat+$swLat)/2)/self::$pasCorrectionCentre,0)*self::$pasCorrectionCentre;
|
117 |
$latCentre = round((($neLat+$swLat)/2)/self::$pasCorrectionCentre,0)*self::$pasCorrectionCentre;
|
Line 104... |
Line 118... |
104 |
$lngCentre = round((($neLng+$swLng)/2)/self::$pasCorrectionCentre,0)*self::$pasCorrectionCentre;
|
118 |
$lngCentre = round((($neLng+$swLng)/2)/self::$pasCorrectionCentre,0)*self::$pasCorrectionCentre;
|
- |
|
119 |
|
105 |
|
120 |
foreach ($noeud['points'] as &$point) {
|
106 |
foreach ($noeud['points'] as &$point) {
|
121 |
self::mettreAJourBornes(&$point);
|
107 |
self::$nbElements['observations']++;
|
122 |
self::$nbElements['observations']++;
|
108 |
$emplacement = isset($point['type_emplacement']) ? $point['type_emplacement'] : self::obtenirTypeEmplacementParId(&$point);
|
123 |
$emplacement = isset($point['type_emplacement']) ? $point['type_emplacement'] : self::obtenirTypeEmplacementParId(&$point);
|
109 |
self::$nbElements[$emplacement]++;
|
124 |
self::$nbElements[$emplacement]++;
|