124,14 → 124,13 |
|
$infos_commune_json = @file_get_contents($this->adresse_service_geonames. |
$this->nom_service_reverse_geocoding. |
"?featureClass=ADM4&lat=".urlencode($lat)."&lng=".urlencode($lon). |
"?lat=".urlencode($lat)."&lng=".urlencode($lon). |
"&style=full") ; |
|
$objet_retour = json_decode($infos_commune_json); |
|
$retour = false; |
if($this->estUnRetourReverseGeocodingGeonamesValide($objet_retour)) { |
$retour = array('nom' => $objet_retour->geonames[0]->name, 'code_insee' => $objet_retour->geonames[0]->adminCode4); |
$retour = array('nom' => $objet_retour->geonames[0]->adminName4, 'code_insee' => $objet_retour->geonames[0]->adminCode4); |
} |
|
return $retour; |