Subversion Repositories eFlore/Applications.cel

Rev

Rev 809 | Rev 1311 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 809 Rev 970
Line 19... Line 19...
19
	
19
	
Line 20... Line 20...
20
	function CoordSearch($config) {
20
	function CoordSearch($config) {
Line 21... Line 21...
21
		
21
		
22
		parent::__construct($config);
22
		parent::__construct($config);
Line 23... Line 23...
23
		
23
		
24
		$this->adresse_service_geonames = $this->config['cel_db']['url_service_geo_geonames'];
24
		$this->adresse_service_geonames = $this->config['cel']['url_service_geo_geonames'];
25
		$this->adresse_service_local = $this->config['cel_db']['url_service_geo_local'];
25
		$this->adresse_service_local = $this->config['cel']['url_service_geo_local'];
Line 26... Line 26...
26
		
26
		
27
		$this->nom_service_geocoding = $this->config['cel_db']['nom_service_geocoding_geonames'];
27
		$this->nom_service_geocoding = $this->config['cel']['nom_service_geocoding_geonames'];
28
		$this->nom_service_reverse_geocoding = $this->config['cel_db']['nom_service_reverse_geocoding_geonames'];
28
		$this->nom_service_reverse_geocoding = $this->config['cel']['nom_service_reverse_geocoding_geonames'];
Line 54... Line 54...
54
			
54
			
55
			$header = 'Content-Type: application/json; charset=UTF-8';
55
			$header = 'Content-Type: application/json; charset=UTF-8';
Line 56... Line 56...
56
			$retour = json_encode($informations_communes) ;
56
			$retour = json_encode($informations_communes) ;
57
 
57
 
58
	    } elseif ($this->estUneRequeteGeocoding($params)) {
58
	    } elseif ($this->estUneRequeteGeocoding($params)) {
Line 59... Line 59...
59
	    	
59
	    	    	
60
	    	$informations_coord = $this->effectuerRequeteGeocodingGeonames($params['commune'],$params['code_postal'],$params['code_pays']);
60
	    	$informations_coord = $this->effectuerRequeteGeocodingGeonames($params['commune'],$params['code_postal'],$params['code_pays']);
Line 77... Line 77...
77
		$lat = $this->affecterValeurParametreOuDefaut($params, 0, '*');
77
		$lat = $this->affecterValeurParametreOuDefaut($params, 0, '*');
78
		$lng = $this->affecterValeurParametreOuDefaut($params, 1, '*'); 
78
		$lng = $this->affecterValeurParametreOuDefaut($params, 1, '*'); 
Line 79... Line 79...
79
 
79
 
80
		$commune = $this->affecterValeurParametreOuDefaut($params, 2, '*'); 
80
		$commune = $this->affecterValeurParametreOuDefaut($params, 2, '*'); 
-
 
81
		$code_postal = $this->affecterValeurParametreOuDefaut($params, 3, '*');
-
 
82
		
-
 
83
		if(strlen($code_postal) > 2) {
-
 
84
			$code_postal = substr($code_postal,0,2);	
Line 81... Line 85...
81
		$code_postal = $this->affecterValeurParametreOuDefaut($params, 3, '*');
85
		}
Line 82... Line 86...
82
 
86
 
83
		$code_pays = $this->affecterValeurParametreOuDefaut($params, 4, 'FR');
87
		$code_pays = $this->affecterValeurParametreOuDefaut($params, 4, 'FR');
Line 102... Line 106...
102
	private function effectuerRequeteReverseGeocodingCartoOsm($lat, $lon) {
106
	private function effectuerRequeteReverseGeocodingCartoOsm($lat, $lon) {
Line 103... Line 107...
103
		
107
		
104
		$infos_commune_json = @file_get_contents($this->url_service_geo_local."?lat=".$lat."&lon=".$lon);
108
		$infos_commune_json = @file_get_contents($this->url_service_geo_local."?lat=".$lat."&lon=".$lon);
Line -... Line 109...
-
 
109
		$infos_commune = json_decode($infos_commune_json);
-
 
110
		
105
		$infos_commune = json_decode($infos_commune_json);
111
		print_r($infos_commune);
Line 106... Line 112...
106
		
112
		
107
		$retour = false;
113
		$retour = false;
108
		
114