Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 795 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 795 Rev 811
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 5.1.1                                                                                    |
4
// | PHP version 5.1.1                                                                                    |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of eFlore-Fiche.                                                                   |
8
// | This file is part of eFlore-Fiche.                                                                   |
9
// |                                                                                                      |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
11
// | it under the terms of the GNU General Public License as published by                                 |
11
// | it under the terms of the GNU General Public License as published by                                 |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
18
// | GNU General Public License for more details.                                                         |
19
// |                                                                                                      |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: effi_cel.action.php,v 1.9 2007-11-06 10:54:03 jp_milcent Exp $
24
// CVS : $Id: effi_cel.action.php,v 1.9 2007-11-06 10:54:03 jp_milcent Exp $
25
/**
25
/**
26
* Fichier d'action du module eFlore-Fiche : Cel
26
* Fichier d'action du module eFlore-Fiche : Cel
27
*
27
*
28
* Appel Carnet en ligne
28
* Appel Carnet en ligne
29
* 
29
* 
30
*
30
*
31
*@package eFlore
31
*@package eFlore
32
*@subpackage ef_fiche
32
*@subpackage ef_fiche
33
//Auteur original :
33
//Auteur original :
34
*@author        David Delon <dd@clapas.net>
34
*@author        David Delon <dd@clapas.net>
35
//Autres auteurs :
35
//Autres auteurs :
36
*@author        aucun
36
*@author        aucun
37
*@copyright     Tela-Botanica 2000-2006
37
*@copyright     Tela-Botanica 2000-2006
38
*@version       $Revision: 1.9 $ $Date: 2007-11-06 10:54:03 $
38
*@version       $Revision: 1.9 $ $Date: 2007-11-06 10:54:03 $
39
// +------------------------------------------------------------------------------------------------------+
39
// +------------------------------------------------------------------------------------------------------+
40
*/
40
*/
41
 
41
 
42
// +------------------------------------------------------------------------------------------------------+
42
// +------------------------------------------------------------------------------------------------------+
43
// |                                            ENTETE du PROGRAMME                                       |
43
// |                                            ENTETE du PROGRAMME                                       |
44
// +------------------------------------------------------------------------------------------------------+
44
// +------------------------------------------------------------------------------------------------------+
45
 
45
 
46
// +------------------------------------------------------------------------------------------------------+
46
// +------------------------------------------------------------------------------------------------------+
47
// |                                            CORPS du PROGRAMME                                        |
47
// |                                            CORPS du PROGRAMME                                        |
48
// +------------------------------------------------------------------------------------------------------+
48
// +------------------------------------------------------------------------------------------------------+
49
 
49
 
50
 
50
 
51
 
51
 
52
// TODO : CSS specifique (id)
52
// TODO : CSS specifique (id)
53
 
53
 
54
class Cartes {
54
class EfloreCartes {
55
	private $tab_code_insee = array();
55
	private $tab_code_insee = array();
56
	public $src_map;
56
	public $src_map;
57
	private $cartesFormateur = null;
57
	private $cartesFormateur = null;
58
	const MIME_MAP = 'text/html';
58
	const MIME_MAP = 'text/html';
59
	const MIME_PNG = 'image/png';
59
	const MIME_PNG = 'image/png';
60
	
60
	
61
	public function consulter($ressources, $param) {
61
	public function consulter($ressources, $param) {
62
		// Initialisation des variables
62
		// Initialisation des variables
63
		$this->ressources = $ressources;
63
		$this->ressources = $ressources;
64
		$this->param = $param;
64
		$this->param = $param;
65
		if ($this->analyserRessources() == true) {
65
		if ($this->analyserRessources() == true) {
66
			$resultat = $this->formerLegende();
66
			$resultat = $this->formerLegende();
67
		} else {
67
		} else {
68
			$this->traiterParametres();
68
			$this->traiterParametres();
69
			$resultat = $this->formerCarte();
69
			$resultat = $this->formerCarte();
70
		}
70
		}
71
		return $resultat;
71
		return $resultat;
72
	}
72
	}
73
	
73
	
74
	public function formerCarte() {
74
	public function formerCarte() {
75
		$this->creerFormateur();
75
		$this->creerFormateur();
76
		$this->cartesFormateur->initialiserImage();
76
		$this->cartesFormateur->initialiserImage();
77
		$inventories = '';
77
		$inventories = '';
78
		if ($this->cartesFormateur->testerParametresProjets() == true) {
78
		if ($this->cartesFormateur->testerParametresProjets() == true) {
79
			$inventories = $this->cartesFormateur->chargerDonnees();
79
			$inventories = $this->cartesFormateur->chargerDonnees();
80
		}
80
		}
81
		$retour = '';
81
		$retour = '';
82
		if (is_array($inventories) && $inventories !== array()){
82
		if (is_array($inventories) && $inventories !== array()){
83
			$this->chargerVille();// Connection referentiel communes
83
			$this->chargerVille();// Connection referentiel communes
84
			list($text, $merge) = $this->calculerRepartition($inventories);
84
			list($text, $merge) = $this->calculerRepartition($inventories);
85
			// Définition des couleurs des points
85
			// Définition des couleurs des points
86
			$couleurs = $this->cartesFormateur->definirCouleurs();
86
			$couleurs = $this->cartesFormateur->definirCouleurs();
87
			if ($text) {
87
			if ($text) {
88
				$usemap = $this->cartesFormateur->dessinerPoint($text, $merge, $couleurs);
88
				$usemap = $this->cartesFormateur->dessinerPoint($text, $merge, $couleurs);
89
			}
89
			}
90
			if (isset($usemap)) {
90
			if (isset($usemap)) {
91
				$this->cartesFormateur->img();
91
				$this->cartesFormateur->img();
92
				$retour = $this->cartesFormateur->formaterCartes($usemap);
92
				$retour = $this->cartesFormateur->formaterCartes($usemap);
93
			}
93
			}
94
		}
94
		}
95
		if ($retour == '') {
95
		if ($retour == '') {
96
			$retour = $this->formaterCarteVide();
96
			$retour = $this->formaterCarteVide();
97
		}
97
		}
98
		$resultat = new ResultatService();
98
		$resultat = new ResultatService();
99
		$resultat->corps = ($this->info['retour'] == self::MIME_MAP) ? $retour : file_get_contents($retour);
99
		$resultat->corps = ($this->info['retour'] == self::MIME_MAP) ? $retour : file_get_contents($retour);
100
		$resultat->mime = ($this->info['retour'] == self::MIME_MAP) ? self::MIME_MAP : self::MIME_PNG;
100
		$resultat->mime = ($this->info['retour'] == self::MIME_MAP) ? self::MIME_MAP : self::MIME_PNG;
101
		return $resultat;
101
		return $resultat;
102
	}
102
	}
103
	
103
	
104
	public function creerFormateur(){
104
	public function creerFormateur(){
105
		$projet = ucwords($this->info['projet']);
105
		$projet = ucwords($this->info['projet']);
106
		$Classe = $projet.'Formateur';
106
		$Classe = $projet.'Formateur';
107
		$chemin = dirname(__FILE__).DS.'cartes'.DS;
107
		$chemin = dirname(__FILE__).DS.'cartes'.DS;
108
		$cheminClasse = $chemin.$Classe.'.php';
108
		$cheminClasse = $chemin.$Classe.'.php';
109
		$cheminInterface = $chemin.'Formateur.php';
109
		$cheminInterface = $chemin.'Formateur.php';
110
		if (file_exists($cheminInterface)) {
110
		if (file_exists($cheminInterface)) {
111
			include_once $cheminInterface;
111
			include_once $cheminInterface;
112
			if (file_exists($cheminClasse)) {
112
			if (file_exists($cheminClasse)) {
113
				include_once $cheminClasse;
113
				include_once $cheminClasse;
114
				$this->cartesFormateur = new $Classe($this->info);
114
				$this->cartesFormateur = new $Classe($this->info);
115
			} else {
115
			} else {
116
				$message = "La classe '$Classe' est introuvable.";Debug::printr($message);
116
				$message = "La classe '$Classe' est introuvable.";Debug::printr($message);
117
				throw new Exception($message);
117
				throw new Exception($message);
118
			}
118
			}
119
		}
119
		}
120
	}
120
	}
121
	private function analyserRessources() {
121
	private function analyserRessources() {
122
		$ok = false;
122
		$ok = false;
123
		if (isset($this->ressources[0]) && $this->ressources[0] == 'legende') {
123
		if (isset($this->ressources[0]) && $this->ressources[0] == 'legende') {
124
			$ok = true;
124
			$ok = true;
125
		}
125
		}
126
		return $ok;
126
		return $ok;
127
	}
127
	}
128
	
128
	
129
	private function formerLegende() {
129
	private function formerLegende() {
130
		$classe = 'LegendeCartes';
130
		$classe = 'LegendeCartes';
131
		require_once dirname(__FILE__).DS.'cartes'.DS.$classe.'.php';
131
		require_once dirname(__FILE__).DS.'cartes'.DS.$classe.'.php';
132
		$sousService = new $classe(new Conteneur());
132
		$sousService = new $classe(new Conteneur());
133
		$resultat = $sousService->consulter($this->ressources, $this->param);
133
		$resultat = $sousService->consulter($this->ressources, $this->param);
134
		return $resultat;
134
		return $resultat;
135
	}
135
	}
136
	
136
	
137
	private function traiterParametres() {
137
	private function traiterParametres() {
138
		$this->info['miniature'] = (isset($this->param['retour.format'])) ? $this->param['retour.format'] : false;
138
		$this->info['miniature'] = (isset($this->param['retour.format'])) ? $this->param['retour.format'] : false;
139
		$this->info['src_map'] = ($this->info['miniature'] == 'min') ? 'france_utm_miniature.png' : 'france_utm_600x564.png';
139
		$this->info['src_map'] = ($this->info['miniature'] == 'min') ? 'france_utm_miniature.png' : 'france_utm_600x564.png';
140
		$this->info['retour'] = (isset($this->param['retour'])) ? $this->param['retour'] : self::MIME_PNG ;
140
		$this->info['retour'] = (isset($this->param['retour'])) ? $this->param['retour'] : self::MIME_PNG ;
141
		// Ajout du code du référentiel
141
		// Ajout du code du référentiel
142
		$this->info['referentiel'] = 'bdtfx';
142
		$this->info['referentiel'] = 'bdtfx';
143
		$projets = array('cenlr', 'cel', 'cbnmed', 'sophy', 'general');
143
		$projets = array('cenlr', 'cel', 'cbnmed', 'sophy', 'general');
144
		if (isset($this->param['projet']) && in_array($this->param['projet'], $projets)) {
144
		if (isset($this->param['projet']) && in_array($this->param['projet'], $projets)) {
145
			$this->info['projet'] = $this->param['projet'];
145
			$this->info['projet'] = $this->param['projet'];
146
		} else {
146
		} else {
147
			$this->info['projet'] = 'general';
147
			$this->info['projet'] = 'general';
148
		}
148
		}
149
		// Récupération d'infos générales
149
		// Récupération d'infos générales
150
		// donnees exemple nn = 141; nt = 8522; nom = 'Acer campestre L.'; nom_ss_auteur = 'Acer campestre';
150
		// donnees exemple nn = 141; nt = 8522; nom = 'Acer campestre L.'; nom_ss_auteur = 'Acer campestre';
151
		$this->info['nn'] = @$this->param['masque.nn'];
151
		$this->info['nn'] = @$this->param['masque.nn'];
152
		$this->info['nt'] = @$this->param['masque.nt'];
152
		$this->info['nt'] = @$this->param['masque.nt'];
153
		$this->info['nom'] = @$this->param['masque.ns'].' '.@$this->param['masque.au'];
153
		$this->info['nom'] = @$this->param['masque.ns'].' '.@$this->param['masque.au'];
154
		$this->info['nom_ss_auteur'] = @$this->param['masque.ns'];
154
		$this->info['nom_ss_auteur'] = @$this->param['masque.ns'];
155
	}
155
	}
156
	
156
	
157
	private function chargerVille() {
157
	private function chargerVille() {
158
		$requete = "SELECT nom as name, code as insee_code, utm_x as x_utm, utm_y as y_utm, utm_secteur as sector".
158
		$requete = "SELECT nom as name, code as insee_code, utm_x as x_utm, utm_y as y_utm, utm_secteur as sector".
159
					" FROM tb_cel.cel_zones_geo;";
159
					" FROM tb_cel.cel_zones_geo;";
160
		$villes = $this->getBdd()->recupererTous($requete);
160
		$villes = $this->getBdd()->recupererTous($requete);
161
		foreach ($villes as $ville) {
161
		foreach ($villes as $ville) {
162
			$this->tab_code_insee[$ville['insee_code']] = $ville;
162
			$this->tab_code_insee[$ville['insee_code']] = $ville;
163
		}
163
		}
164
	}
164
	}
165
	
165
	
166
	private function calculerRepartition($inventories) {
166
	private function calculerRepartition($inventories) {
167
		$text = '';
167
		$text = '';
168
		// Recuperation du positionnement de la carte
168
		// Recuperation du positionnement de la carte
169
		$png_txt = file_get_contents(Config::get('Cartes.chemin').str_replace('png', 'txt', $this->info['src_map']));
169
		$png_txt = file_get_contents(Config::get('Cartes.chemin').str_replace('png', 'txt', $this->info['src_map']));
170
		parse_str($png_txt);
170
		parse_str($png_txt);
171
		// "Resolution" calculer à partir du fichier $png_txt par fuseau
171
		// "Resolution" calculer à partir du fichier $png_txt par fuseau
172
		$p['31T'] = ($X231T - $X131T) / ($X231TUTM - $X131TUTM);
172
		$p['31T'] = ($X231T - $X131T) / ($X231TUTM - $X131TUTM);
173
		$p['32T'] = ($X231T - $X131T ) / ($X231TUTM - $X131TUTM);
173
		$p['32T'] = ($X231T - $X131T ) / ($X231TUTM - $X131TUTM);
174
		$p['30T'] = ($X231T - $X131T ) / ($X231TUTM - $X131TUTM);
174
		$p['30T'] = ($X231T - $X131T ) / ($X231TUTM - $X131TUTM);
175
		
175
		
176
		$text = array();
176
		$text = array();
177
		$merge = array();
177
		$merge = array();
178
		foreach ($inventories as $inventory){
178
		foreach ($inventories as $inventory){
179
			$utm = $this->cartesFormateur->chercherVille($inventory, $this->tab_code_insee);
179
			$utm = $this->cartesFormateur->chercherVille($inventory, $this->tab_code_insee);
180
			// Ultime tentative 
180
			// Ultime tentative 
181
			if (!$utm) {
181
			if (!$utm) {
182
				$requete = "SELECT nom as name, code as insee_code, utm_x as x_utm, utm_y as y_utm, utm_secteur as sector".
182
				$requete = "SELECT nom as name, code as insee_code, utm_x as x_utm, utm_y as y_utm, utm_secteur as sector".
183
					" FROM tb_cel.cel_zones_geo WHERE nom LIKE ".$this->getBdd()->proteger($inventory['location']);
183
					" FROM tb_cel.cel_zones_geo WHERE nom LIKE ".$this->getBdd()->proteger($inventory['location']);
184
				$utm = $this->getBdd()->recupererTous($requete);
184
				$utm = $this->getBdd()->recupererTous($requete);
185
			}
185
			}
186
 
186
 
187
			// Si des doublons sur la commune : pas d'affichage , il vaut mieux ne rien afficher que d'afficher des erreurs.
187
			// Si des doublons sur la commune : pas d'affichage , il vaut mieux ne rien afficher que d'afficher des erreurs.
188
			if (sizeof($utm) == 1) {
188
			if (sizeof($utm) == 1) {
189
				$utm = $utm[0];
189
				$utm = $utm[0];
190
					
190
					
191
				// On centre le point au milieu de la maille 10x10 par defaut ...
191
				// On centre le point au milieu de la maille 10x10 par defaut ...
192
				$utm = $this->chercherCentreMaille($utm);
192
				$utm = $this->chercherCentreMaille($utm);
193
					
193
					
194
				// Calcul coordonnes x, y sur l'image
194
				// Calcul coordonnes x, y sur l'image
195
				if ($utm['sector']=='31T') {// Fuseau 31 T
195
				if ($utm['sector']=='31T') {// Fuseau 31 T
196
					$x = (($utm['x_utm'] - $X131TUTM) * $p['31T'] ) + $X131T;
196
					$x = (($utm['x_utm'] - $X131TUTM) * $p['31T'] ) + $X131T;
197
					$y = $Y231T - (($utm['y_utm'] - $Y131TUTM) * $p['31T'] );
197
					$y = $Y231T - (($utm['y_utm'] - $Y131TUTM) * $p['31T'] );
198
				} elseif ($utm['sector'] == '32T') {// Fuseau 32 T : une rotation + translation est appliqu�e
198
				} elseif ($utm['sector'] == '32T') {// Fuseau 32 T : une rotation + translation est appliqu�e
199
					$cosa = cos(deg2rad($angle3132));
199
					$cosa = cos(deg2rad($angle3132));
200
					$sina = sin(deg2rad($angle3132));
200
					$sina = sin(deg2rad($angle3132));
201
					$xp = (($utm['x_utm'] - $X132TUTM) * $cosa) + (($utm['y_utm']- $Y132TUTM) * $sina);
201
					$xp = (($utm['x_utm'] - $X132TUTM) * $cosa) + (($utm['y_utm']- $Y132TUTM) * $sina);
202
					$yp = (-($utm['x_utm'] - $X132TUTM)* $sina) + (($utm['y_utm'] - $Y132TUTM) * $cosa);
202
					$yp = (-($utm['x_utm'] - $X132TUTM)* $sina) + (($utm['y_utm'] - $Y132TUTM) * $cosa);
203
					$x = ($xp * $p['32T'] ) + $X132T;
203
					$x = ($xp * $p['32T'] ) + $X132T;
204
					$y = $Y232T-($yp * $p['32T'] );
204
					$y = $Y232T-($yp * $p['32T'] );
205
				} elseif ($utm['sector'] == '30T') {// Fuseau 30 T : une rotation + translation est appliqu�e
205
				} elseif ($utm['sector'] == '30T') {// Fuseau 30 T : une rotation + translation est appliqu�e
206
					$cosa = cos(deg2rad($angle3031));
206
					$cosa = cos(deg2rad($angle3031));
207
					$sina = sin(deg2rad($angle3031));
207
					$sina = sin(deg2rad($angle3031));
208
					$xp = (($utm['x_utm'] - $X130TUTM) * $cosa) + (($utm['y_utm'] - $Y130TUTM) * $sina);
208
					$xp = (($utm['x_utm'] - $X130TUTM) * $cosa) + (($utm['y_utm'] - $Y130TUTM) * $sina);
209
					$yp = (-($utm['x_utm'] - $X130TUTM) * $sina) + (($utm['y_utm'] - $Y130TUTM) * $cosa);
209
					$yp = (-($utm['x_utm'] - $X130TUTM) * $sina) + (($utm['y_utm'] - $Y130TUTM) * $cosa);
210
					$x = ($xp * $p['30T'] ) + $X130T;
210
					$x = ($xp * $p['30T'] ) + $X130T;
211
					$y = $Y230T - ($yp * $p['30T'] );
211
					$y = $Y230T - ($yp * $p['30T'] );
212
				}
212
				}
213
				$x = round($x);
213
				$x = round($x);
214
				$y = round($y);
214
				$y = round($y);
215
					
215
					
216
					
216
					
217
				if ($utm['name'] != null) {
217
				if ($utm['name'] != null) {
218
					$name = utf8_decode($utm['name']);
218
					$name = utf8_decode($utm['name']);
219
				}
219
				}
220
				$comment = ($this->info['retour'] == self::MIME_MAP) ? $this->cartesFormateur->formerCommentaire($utm, $inventory) : '';
220
				$comment = ($this->info['retour'] == self::MIME_MAP) ? $this->cartesFormateur->formerCommentaire($utm, $inventory) : '';
221
				// On stocke les commentaires pour affichage dans les tooltips
221
				// On stocke les commentaires pour affichage dans les tooltips
222
				// Commentaire deja présent ? : on ajoute à la suite
222
				// Commentaire deja présent ? : on ajoute à la suite
223
				list($text, $merge) = $this->cartesFormateur->stockerCommentaire($text, $merge, $name, $comment, $inventory['collection_code'],$x,$y); 
223
				list($text, $merge) = $this->cartesFormateur->stockerCommentaire($text, $merge, $name, $comment, $inventory['collection_code'],$x,$y); 
224
			}
224
			}
225
		}
225
		}
226
			
226
			
227
		return array($text, $merge);
227
		return array($text, $merge);
228
	}
228
	}
229
	
229
	
230
 
230
 
231
	
231
	
232
	private function formaterCarteVide() {
232
	private function formaterCarteVide() {
233
		$this->cheminCartesBase = Config::get('Cartes.chemin');
233
		$this->cheminCartesBase = Config::get('Cartes.chemin');
234
		$dest_map['vide'] = 'vide_'.$this->info['src_map'];
234
		$dest_map['vide'] = 'vide_'.$this->info['src_map'];
235
		$img['vide'] = imagecreatefrompng($this->cheminCartesBase.$this->info['src_map']);
235
		$img['vide'] = imagecreatefrompng($this->cheminCartesBase.$this->info['src_map']);
236
		imagepng($img['vide'], Config::get('cache_stockageChemin').$dest_map['vide'], 9);
236
		imagepng($img['vide'], Config::get('cache_stockageChemin').$dest_map['vide'], 9);
237
		$retour = Config::get('cel_dst').$dest_map['vide'];
237
		$retour = Config::get('cel_dst').$dest_map['vide'];
238
		if ($this->info['retour'] == self::MIME_MAP) {
238
		if ($this->info['retour'] == self::MIME_MAP) {
239
			$retour =  "<img src=\"".$retour."\" style=\"border:none; cursor:crosshair\" alt=\"\" />\n";
239
			$retour =  "<img src=\"".$retour."\" style=\"border:none; cursor:crosshair\" alt=\"\" />\n";
240
		}
240
		}
241
		return $retour;
241
		return $retour;
242
	}
242
	}
243
	
243
	
244
 
244
 
245
	
245
	
246
	
246
	
247
	//+----------------------------------------------------------------------------------------------------------------+
247
	//+----------------------------------------------------------------------------------------------------------------+
248
	// sous fonction de calculer répartition
248
	// sous fonction de calculer répartition
249
	
249
	
250
	
250
	
251
	private function chercherCentreMaille($utm) {
251
	private function chercherCentreMaille($utm) {
252
		$pad = str_repeat ('0' ,(7 - strlen( $utm['x_utm'])));
252
		$pad = str_repeat ('0' ,(7 - strlen( $utm['x_utm'])));
253
		$utm['x_utm'] = $pad.$utm['x_utm'];
253
		$utm['x_utm'] = $pad.$utm['x_utm'];
254
	
254
	
255
		$pad = str_repeat ('0' ,(7 - strlen( $utm['y_utm'])));
255
		$pad = str_repeat ('0' ,(7 - strlen( $utm['y_utm'])));
256
		$utm['y_utm'] = $pad.$utm['y_utm'];
256
		$utm['y_utm'] = $pad.$utm['y_utm'];
257
	
257
	
258
		$utm['x_utm'] = substr($utm['x_utm'] ,0,3);
258
		$utm['x_utm'] = substr($utm['x_utm'] ,0,3);
259
		$utm['x_utm'] = $utm['x_utm'].'5000';
259
		$utm['x_utm'] = $utm['x_utm'].'5000';
260
	
260
	
261
		$utm['y_utm'] = substr($utm['y_utm'] ,0,3);
261
		$utm['y_utm'] = substr($utm['y_utm'] ,0,3);
262
		$utm['y_utm'] = $utm['y_utm'].'5000';
262
		$utm['y_utm'] = $utm['y_utm'].'5000';
263
		return $utm;
263
		return $utm;
264
	}
264
	}
265
 
265
 
266
	//+----------------------------------------------------------------------------------------------------------------+
266
	//+----------------------------------------------------------------------------------------------------------------+
267
	// Méthodes d'accès aux objets du Framework
267
	// Méthodes d'accès aux objets du Framework
268
	/**
268
	/**
269
	* Méthode de connection à la base de données sur demande.
269
	* Méthode de connection à la base de données sur demande.
270
	* Tous les services web n'ont pas besoin de s'y connecter.
270
	* Tous les services web n'ont pas besoin de s'y connecter.
271
	*/
271
	*/
272
	protected function getBdd() {
272
	protected function getBdd() {
273
		if (! isset($this->Bdd)) {
273
		if (! isset($this->Bdd)) {
274
			$this->Bdd = new Bdd();
274
			$this->Bdd = new Bdd();
275
		}
275
		}
276
	return $this->Bdd;
276
	return $this->Bdd;
277
	}
277
	}
278
	
278
	
279
 
279
 
280
	
280
	
281
}
281
}
282
?>
282
?>