Subversion Repositories eFlore/Applications.cel

Rev

Rev 1034 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1034 Rev 1106
Line 16... Line 16...
16
	private static $nbElements = array('stations' => 0,'communes' => 0, 'observations' => 0);
16
	private static $nbElements = array('stations' => 0,'communes' => 0, 'observations' => 0);
Line 17... Line 17...
17
 
17
 
Line 18... Line 18...
18
	private static $listeNoeudsSelectionnes = array();
18
	private static $listeNoeudsSelectionnes = array();
-
 
19
	
-
 
20
	private static $pointsDejaTraites = array();
Line 19... Line 21...
19
	
21
	
20
	private static $pointsDejaTraites = array();
22
	private static $bornesMax = array('latMin' => null, 'lngMin' => null, 'latMax' => null, 'lngMax' => null);
21
 
23
 
22
	/*
24
	/*
Line 41... Line 43...
41
 
43
 
42
			$noeudRacine = array('nbrePoints' => count($markers), 'points' => $markers);
44
			$noeudRacine = array('nbrePoints' => count($markers), 'points' => $markers);
Line 43... Line 45...
43
			self::attribuerAuCadran($noeudRacine, $neLat, $neLng, $swLat, $swLng);	
45
			self::attribuerAuCadran($noeudRacine, $neLat, $neLng, $swLat, $swLng);	
44
			
46
			
-
 
47
		} else {
45
		} 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']++;
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]++;