Subversion Repositories eFlore/Applications.moissonnage

Rev

Rev 31 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31 Rev 34
Line 7... Line 7...
7
	private $latitudeNord;
7
	private $latitudeNord;
8
	private $longitudeEst;
8
	private $longitudeEst;
9
	private $indexLatitude;
9
	private $indexLatitude;
10
	private $indexLongitude;
10
	private $indexLongitude;
Line 11... Line 11...
11
	
11
	
12
	private $points = array();
-
 
13
	private $nombrePoints;
12
	private $stations = array();
14
	private $observations = array();
-
 
Line 15... Line 13...
15
	private $nombreObservations;
13
	private $observations = array();
16
	
14
	
17
	
15
	
Line 22... Line 20...
22
		$this->longitudeEst = $est;
20
		$this->longitudeEst = $est;
23
		$this->indexLatitude = $indexLat;
21
		$this->indexLatitude = $indexLat;
24
		$this->indexLongitude = $indexLng;
22
		$this->indexLongitude = $indexLng;
25
	}
23
	}
Line 26... Line 24...
26
	
24
	
27
	public function ajouterPoint($point) {
25
	public function ajouterStation($station, $source) {
28
		$this->points[] = $point;
26
		if (!array_key_exists($source, $this->stations)) {
29
		$this->nombrePoints ++;
27
			$this->stations[$source] = 1;
-
 
28
			$this->observations[$source] = $station['observations'];
-
 
29
		} else {
30
		$this->observations[] = $point['observations'];
30
			$this->stations[$source] += 1;
-
 
31
			$this->observations[$source] += intval($station['observations']);
31
		$this->nombreObservations += $point['observations'];
32
		}
Line 32... Line 33...
32
	}
33
	}
33
	
34
	
34
	public function getLatitudeNord() {
35
	public function getLatitudeNord() {
Line 53... Line 54...
53
	
54
	
54
	public function getIndexLongitude() {
55
	public function getIndexLongitude() {
55
		return $this->indexLongitude;
56
		return $this->indexLongitude;
Line 56... Line 57...
56
	}
57
	}
57
	
58
	
58
	public function getPoints() {
59
	public function getStations() {
Line 59... Line 60...
59
		return $this->points;
60
		return $this->stations;
60
	}
61
	}
61
	
62
	
Line 62... Line 63...
62
	public function getNombrePoints() {
63
	public function getNombreStations() {
63
		return $this->nombrePoints;
64
		return count($this->stations);
64
	}
65
	}
Line 65... Line 66...
65
	
66
	
-
 
67
	public function getObservations() {
-
 
68
		return $this->observations;
-
 
69
	}
66
	public function getObservations() {
70
	
-
 
71
	public function combinerMailles($maille, $sourceReference) {
67
		return $this->observations;
72
		if (is_array($maille['stations'])) {
68
	}
-
 
69
	
73
			foreach ($maille['stations'] as $source => $nombreStations) {
70
	public function getNombreObservations() {
74
				if (!array_key_exists($source, $this->stations)) {
71
		return $this->nombreObservations;
75
					$this->stations[$source] = $nombreStations;
72
	}
76
					$this->observations[$source] = $maille['observations'][$source];
-
 
77
				} else {
-
 
78
					$this->stations[$source] += $nombreStations;
73
 
79
					$this->observations[$source] += $maille['observations'][$source];
-
 
80
				}
-
 
81
			}
74
	public function totalNonNul() {
82
		} else {
75
		return count($this->points) > 0;
83
			if (!array_key_exists($sourceReference, $this->stations)) {
-
 
84
				$this->stations[$sourceReference] = $maille['stations'];
-
 
85
				$this->observations[$sourceReference] = $maille['observations'];
76
	}
86
			} else {
Line 77... Line 87...
77
	
87
				$this->stations[$sourceReference] += $maille['stations'];
Line 78... Line 88...
78
	public function combinerMailles(& $maille) {
88
				$this->observations[$sourceReference] += $maille['observations'];
79
		$this->nombrePoints += $maille->nombre_sites;
89
			}