ajout restaurant et cuisine
This commit is contained in:
parent
a1c5647b43
commit
0577081581
10 changed files with 192 additions and 29 deletions
|
@ -151,9 +151,9 @@ QUERY;
|
|||
[out:json][timeout:25];
|
||||
area["postal_code"="{$zone}"]->.searchArea;
|
||||
(
|
||||
nw["amenity"]["cafe|bar|restaurant"](area.searchArea);
|
||||
nw["amenity"]["cafe|bar|restaurant|library|cinema|fast_food"](area.searchArea);
|
||||
nw["shop"](area.searchArea);
|
||||
nw["tourism"="museum"](area.searchArea);
|
||||
nw["tourism"="museum|hotel|chalet|apartment"](area.searchArea);
|
||||
nw["office"](area.searchArea);
|
||||
);
|
||||
out body;
|
||||
|
@ -247,6 +247,16 @@ QUERY;
|
|||
return $osm_object_data['node'];
|
||||
}
|
||||
if(isset($osm_object_data['way'])){
|
||||
// Vérifier si le way a des tags
|
||||
if (!isset($osm_object_data['way']['tag'])) {
|
||||
$osm_object_data['way']['tags_converted'] = [];
|
||||
return $osm_object_data['way'];
|
||||
}
|
||||
|
||||
// Si un seul tag, le convertir en tableau
|
||||
if (isset($osm_object_data['way']['tag']['@attributes'])) {
|
||||
$osm_object_data['way']['tag'] = [$osm_object_data['way']['tag']];
|
||||
}
|
||||
foreach ($osm_object_data['way']['tag'] as $attribute) {
|
||||
$osm_object_data['way']['tags_converted'][$attribute['@attributes']['k']] = $attribute['@attributes']['v'];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue