Subversion Repositories eFlore/Applications.moissonnage

Rev

Rev 26 | Go to most recent revision | Blame | Compare with Previous | 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 $nombrePoints;
        private $observations = array();
        private $nombreObservations;
        
        
        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->nombrePoints ++;
                $this->observations[] = $point['observations'];
                $this->nombreObservations += $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 $this->nombrePoints;
        }
        
        public function getObservations() {
                return $this->observations;
        }
        
        public function getNombreObservations() {
                return $this->nombreObservations;
        }

        public function totalNonNul() {
                return count($this->points) > 0;
        }
        
        public function combinerMailles(& $maille) {
                $this->nombrePoints += $maille->nombre_sites;
                $this->nombreObservations += $maille->nombre_observations;
        }
        
}

?>