Subversion Repositories eFlore/Applications.moissonnage

Rev

Blame | Last modification | View Log | RSS feed

<?php

class Maille {
        
        private $latitudeSud;
        private $longitudeOuest;
        private $latitudeNord;
        private $longitudeEst;
        private $indexLatitude;
        private $indexLongitude;
        
        private $points = array();
        private $observations = array();
        
        
        public function __construct($sud, $ouest, $nord, $est, $indexLat, $indexLng) {
                $this->latitudeSud = $sud;
                $this->longitudeOuest = $ouest;
                $this->latitudeNord = $nord;
                $this->longitudeEst = $est;
                $this->indexLatitude = $indexLat;
                $this->indexLongitude = $indexLng;
        }
        
        public function ajouterPoint($point) {
                $this->points[] = $point;
                $this->observations[] = $point['observations'];
        }
        
        public function getLatitudeNord() {
                return $this->latitudeNord;
        }
        
        public function getLongitudeOuest() {
                return $this->longitudeOuest;
        }
        
        public function getLatitudeSud() {
                return $this->latitudeSud;
        }
        
        public function getLongitudeEst() {
                return $this->longitudeEst;
        }
        
        public function getIndexLatitude() {
                return $this->indexLatitude;
        }
        
        public function getIndexLongitude() {
                return $this->indexLongitude;
        }
        
        public function getPoints() {
                return $this->points;
        }
        
        public function getNombrePoints() {
                return count($this->points);
        }
        
        public function getNombreObservations() {
                return array_sum($this->observations);
        }
        
        public function getPoint($index = 0) {
                return (!isset($this->points[$index])) ? NULL : $this->points[$index];
        }
        
        public function totalNonNul() {
                return count($this->points) > 0;
        }
        
}

?>