thèmes en plus, graph embed

This commit is contained in:
Tykayn 2025-06-30 15:03:37 +02:00 committed by tykayn
parent 4300278f15
commit f4e8c70ead
7 changed files with 327 additions and 9 deletions

View file

@ -48,6 +48,22 @@ class FollowUpService
}) ?? [];
} elseif ($type === 'bicycle_parking') {
$objects = array_filter($elements, fn($el) => ($el['tags']['amenity'] ?? null) === 'bicycle_parking') ?? [];
} elseif ($type === 'advertising_board') {
$objects = array_filter($elements, fn($el) => ($el['tags']['advertising'] ?? null) === 'board' && ($el['tags']['message'] ?? null) === 'political') ?? [];
} elseif ($type === 'building') {
$objects = array_filter($elements, fn($el) => ($el['type'] ?? null) === 'way' && !empty($el['tags']['building'])) ?? [];
} elseif ($type === 'email') {
$objects = array_filter($elements, fn($el) => !empty($el['tags']['email'] ?? null) || !empty($el['tags']['contact:email'] ?? null)) ?? [];
} elseif ($type === 'bench') {
$objects = array_filter($elements, fn($el) => ($el['tags']['amenity'] ?? null) === 'bench') ?? [];
} elseif ($type === 'waste_basket') {
$objects = array_filter($elements, fn($el) => ($el['tags']['amenity'] ?? null) === 'waste_basket') ?? [];
} elseif ($type === 'street_lamp') {
$objects = array_filter($elements, fn($el) => ($el['tags']['highway'] ?? null) === 'street_lamp') ?? [];
} elseif ($type === 'drinking_water') {
$objects = array_filter($elements, fn($el) => ($el['tags']['amenity'] ?? null) === 'drinking_water') ?? [];
} elseif ($type === 'tree') {
$objects = array_filter($elements, fn($el) => ($el['tags']['natural'] ?? null) === 'tree') ?? [];
} elseif ($type === 'places') {
$objects = [];
} else {
@ -128,6 +144,43 @@ class FollowUpService
$completed = array_filter($data['objects'], function($el) {
return !empty($el['tags']['capacity'] ?? null) || !empty($el['tags']['covered'] ?? null);
});
} elseif ($type === 'advertising_board') {
$completed = array_filter($data['objects'], function($el) {
// On considère complet si le tag "operator" ou "ref" est présent
return !empty($el['tags']['operator'] ?? null) || !empty($el['tags']['ref'] ?? null);
});
} elseif ($type === 'building') {
$completed = array_filter($data['objects'], function($el) {
// Complet si ref:FR:RNB est rempli
return !empty($el['tags']['ref:FR:RNB'] ?? null);
});
} elseif ($type === 'email') {
$completed = $data['objects']; // Possède déjà un email ou contact:email
} elseif ($type === 'bench') {
$completed = array_filter($data['objects'], function($el) {
// Complet si le tag "material" ou "backrest" est présent
return !empty($el['tags']['material'] ?? null) || !empty($el['tags']['backrest'] ?? null);
});
} elseif ($type === 'waste_basket') {
$completed = array_filter($data['objects'], function($el) {
// Complet si le tag "material" ou "ref" est présent
return !empty($el['tags']['material'] ?? null) || !empty($el['tags']['ref'] ?? null);
});
} elseif ($type === 'street_lamp') {
$completed = array_filter($data['objects'], function($el) {
// Complet si le tag "lamp_type" ou "ref" est présent
return !empty($el['tags']['lamp_type'] ?? null) || !empty($el['tags']['ref'] ?? null);
});
} elseif ($type === 'drinking_water') {
$completed = array_filter($data['objects'], function($el) {
// Complet si le tag "covered" ou "ref" est présent
return !empty($el['tags']['covered'] ?? null) || !empty($el['tags']['ref'] ?? null);
});
} elseif ($type === 'tree') {
$completed = array_filter($data['objects'], function($el) {
// Complet si le tag "species" ou "ref" est présent
return !empty($el['tags']['species'] ?? null) || !empty($el['tags']['ref'] ?? null);
});
}
if ($type === 'lieux') {
// Si le type est "lieux", on utilise la méthode completionPercent() de $stats
@ -251,6 +304,14 @@ class FollowUpService
'police' => 'Commissariats',
'healthcare' => 'Lieux de santé',
'bicycle_parking' => 'Parkings vélos',
'advertising_board' => 'Panneaux électoraux',
'building' => 'Bâtiments',
'email' => 'Objets avec email',
'bench' => 'Bancs',
'waste_basket' => 'Poubelles',
'street_lamp' => 'Lampadaires',
'drinking_water' => 'Eau potable',
'tree' => 'Arbres',
'places' => 'Lieux'
];
}
@ -271,6 +332,14 @@ class FollowUpService
'police' => 'bi-shield-lock',
'healthcare' => 'bi-hospital',
'bicycle_parking' => 'bi-bicycle',
'advertising_board' => 'bi-easel',
'building' => 'bi-building',
'email' => 'bi-envelope-at',
'bench' => 'bi-badge-wc',
'waste_basket' => 'bi-trash',
'street_lamp' => 'bi-lightbulb',
'drinking_water' => 'bi-droplet-half',
'tree' => 'bi-tree',
'places' => 'bi-geo-alt'
];
}
@ -291,6 +360,14 @@ class FollowUpService
'police' => 'nwr["amenity"="police"](area.searchArea);',
'healthcare' => 'nwr["healthcare"](area.searchArea);nwr["amenity"="doctors"](area.searchArea);nwr["amenity"="pharmacy"](area.searchArea);nwr["amenity"="hospital"](area.searchArea);nwr["amenity"="clinic"](area.searchArea);nwr["amenity"="social_facility"](area.searchArea);',
'bicycle_parking' => 'nwr["amenity"="bicycle_parking"](area.searchArea);',
'advertising_board' => 'nwr["advertising"="board"]["message"="political"](area.searchArea);',
'building' => 'way["building"](area.searchArea);',
'email' => 'nwr["email"](area.searchArea);nwr["contact:email"](area.searchArea);',
'bench' => 'nwr["amenity"="bench"](area.searchArea);',
'waste_basket' => 'nwr["amenity"="waste_basket"](area.searchArea);',
'street_lamp' => 'nwr["highway"="street_lamp"](area.searchArea);',
'drinking_water' => 'nwr["amenity"="drinking_water"](area.searchArea);',
'tree' => 'nwr["natural"="tree"](area.searchArea);',
'places' => ''
];
}

View file

@ -11,7 +11,7 @@ class Motocultrice
public $overpass_base_places = '
(
nw["amenity"~"^(cafe|bar|restaurant|library|cinema|fast_food|post_office|marketplace|community_centre|theatre|bank|townhall|animal_boarding|animal_breeding|animal_shelter|animal_training|archive|arts_centre|bicycle_rental|biergarten|boat_rental|boat_storage|bureau_de_change|canteen|car_rental|car_wash|casino|childcare|clinic|college|conference_centre|courthouse|coworking_space|crematorium|dancing_school|dentist|dive_centre|doctors)$"](area.searchArea);
nw["amenity"~"^(cafe|bar|restaurant|library|cinema|fast_food|post_office|marketplace|community_centre|theatre|bank|townhall|animal_boarding|animal_breeding|animal_shelter|animal_training|archive|arts_centre|bicycle_rental|biergarten|boat_rental|boat_storage|bureau_de_change|canteen|car_rental|car_wash|casino|childcare|clinic|college|conference_centre|courthouse|coworking_space|crematorium|dancing_school|dentist|dive_centre|doctors|vehicle_inspection|driving_school)$"](area.searchArea);
nw["shop"]["shop"!~"vacant"](area.searchArea);
nw["tourism"~"^(hotel|hostel|motel|wilderness_hut|yes|chalet|gallery|guest_house|museum|zoo|theme_park|aquarium|alpine_hut|apartment)$"](area.searchArea);
nw["healthcare"](area.searchArea);
@ -583,6 +583,15 @@ area["ref:INSEE"="$zone"]->.searchArea;
nwr["amenity"="school"](area.searchArea);
nwr["amenity"="police"](area.searchArea);
nwr["amenity"="bicycle_parking"](area.searchArea);
nwr["advertising"="board"]["message"="political"](area.searchArea);
way["building"](area.searchArea);
nwr["email"](area.searchArea);
nwr["contact:email"](area.searchArea);
nwr["amenity"="bench"](area.searchArea);
nwr["amenity"="waste_basket"](area.searchArea);
nwr["highway"="street_lamp"](area.searchArea);
nwr["amenity"="drinking_water"](area.searchArea);
nwr["natural"="tree"](area.searchArea);
);
(._;>;);
out meta;