Subversion Repositories eFlore/Applications.moissonnage

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
29 alex 1
<?php
2
 
3
class Maille {
4
 
5
	private $latitudeSud;
6
	private $longitudeOuest;
7
	private $latitudeNord;
8
	private $longitudeEst;
9
	private $indexLatitude;
10
	private $indexLongitude;
11
 
12
	private $points = array();
13
	private $observations = array();
14
 
15
 
16
	public function __construct($sud, $ouest, $nord, $est, $indexLat, $indexLng) {
17
		$this->latitudeSud = $sud;
18
		$this->longitudeOuest = $ouest;
19
		$this->latitudeNord = $nord;
20
		$this->longitudeEst = $est;
21
		$this->indexLatitude = $indexLat;
22
		$this->indexLongitude = $indexLng;
23
	}
24
 
25
	public function ajouterPoint($point) {
26
		$this->points[] = $point;
27
		$this->observations[] = $point['observations'];
28
	}
29
 
30
	public function getLatitudeNord() {
31
		return $this->latitudeNord;
32
	}
33
 
34
	public function getLongitudeOuest() {
35
		return $this->longitudeOuest;
36
	}
37
 
38
	public function getLatitudeSud() {
39
		return $this->latitudeSud;
40
	}
41
 
42
	public function getLongitudeEst() {
43
		return $this->longitudeEst;
44
	}
45
 
46
	public function getIndexLatitude() {
47
		return $this->indexLatitude;
48
	}
49
 
50
	public function getIndexLongitude() {
51
		return $this->indexLongitude;
52
	}
53
 
54
	public function getPoints() {
55
		return $this->points;
56
	}
57
 
58
	public function getNombrePoints() {
59
		return count($this->points);
60
	}
61
 
62
	public function getNombreObservations() {
63
		return array_sum($this->observations);
64
	}
65
 
66
	public function getPoint($index = 0) {
67
		return (!isset($this->points[$index])) ? NULL : $this->points[$index];
68
	}
69
 
70
	public function totalNonNul() {
71
		return count($this->points) > 0;
72
	}
73
 
74
}
75
 
76
?>