Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1684 Rev 1686
Line 697... Line 697...
697
													'country' => $data['pays'])),
697
													'country' => $data['pays'])),
698
								 $opts ? $opts : array());
698
								 $opts ? $opts : array());
699
		}
699
		}
700
		$fullquery = 'http://nominatim.openstreetmap.org/search.php?' . http_build_query($query);
700
		$fullquery = 'http://nominatim.openstreetmap.org/search.php?' . http_build_query($query);
Line -... Line 701...
-
 
701
 
701
 
702
        $ctx = stream_context_create(array('http' => array( 'timeout' => '4' )));
702
        $r = json_decode(file_get_contents($fullquery));
703
        $r = json_decode(file_get_contents($fullquery, FALSE, $ctx));
703
		error_log(sprintf("COEL: Nominatim request returned %d result(s) [%s]", count($r), $fullquery));
704
		error_log(sprintf("COEL: Nominatim request returned %d result(s) [%s]", count($r), $fullquery));
704
		if($r && isset($r[0])) {
705
		if($r && isset($r[0])) {
705
			$lonlat['lon'] = $r[0]->lon;
706
			$lonlat['lon'] = $r[0]->lon;
706
			$lonlat['lat'] = $r[0]->lat;
707
			$lonlat['lat'] = $r[0]->lat;