mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-09 17:02:46 +02:00
followup service refacto
This commit is contained in:
parent
1c2c3575f9
commit
0611b28172
7 changed files with 341 additions and 596 deletions
|
@ -17,37 +17,11 @@
|
|||
</a>
|
||||
</div>
|
||||
<p>Historique des objets suivis (nombre et complétion).</p>
|
||||
{% set type_labels = {
|
||||
'fire_hydrant': 'Bornes incendie',
|
||||
'charging_station': 'Bornes de recharge',
|
||||
'toilets': 'Toilettes publiques',
|
||||
'bus_stop': 'Arrêts de bus',
|
||||
'defibrillator': 'Défibrillateurs',
|
||||
'camera': 'Caméras de surveillance',
|
||||
'recycling': 'Points de recyclage',
|
||||
'substation': 'Sous-stations électriques',
|
||||
'laboratory': "Laboratoires d'analyse",
|
||||
'school': 'Écoles',
|
||||
'police': 'Commissariats',
|
||||
'healthcare': 'Lieux de santé'
|
||||
} %}
|
||||
{% for type in type_labels|keys %}
|
||||
<h2 id="title-{{ type }}">{{ type_labels[type] }}</h2>
|
||||
{% for type, label in followup_labels %}
|
||||
<h2 id="title-{{ type }}"><i class="bi {{ followup_icons[type]|default('bi-question-circle') }}"></i> {{ label }}</h2>
|
||||
<canvas id="{{ type }}Chart" width="600" height="300"></canvas>
|
||||
<div class="mb-3">
|
||||
{% set overpass_queries = {
|
||||
'fire_hydrant': 'nwr["emergency"="fire_hydrant"](area.searchArea);',
|
||||
'charging_station': 'nwr["amenity"="charging_station"](area.searchArea);',
|
||||
'toilets': 'nwr["amenity"="toilets"](area.searchArea);',
|
||||
'bus_stop': 'nwr["highway"="bus_stop"](area.searchArea);',
|
||||
'defibrillator': 'nwr["emergency"="defibrillator"](area.searchArea);',
|
||||
'camera': 'nwr["man_made"="surveillance"](area.searchArea);',
|
||||
'recycling': 'nwr["amenity"="recycling"](area.searchArea);',
|
||||
'substation': 'nwr["power"="substation"](area.searchArea);',
|
||||
'laboratory': 'nwr["healthcare"="laboratory"](area.searchArea);',
|
||||
'school': 'nwr["amenity"="school"](area.searchArea);'
|
||||
} %}
|
||||
{% set overpass_query = '[out:json][timeout:60];\narea["ref:INSEE"="' ~ stats.zone ~ '"]->.searchArea;\n(' ~ overpass_queries[type]|default('') ~ ');\n\n(._;>;);\n\nout meta;\n>;' %}
|
||||
{% set overpass_query = '[out:json][timeout:60];\narea["ref:INSEE"="' ~ stats.zone ~ '"]->.searchArea;\n(' ~ followup_overpass[type]|default('') ~ ');\n\n(._;>;);\n\nout meta;\n>;' %}
|
||||
<a href="https://overpass-turbo.eu/?Q={{ overpass_query|url_encode }}" target="_blank" class="btn btn-sm btn-outline-primary me-2">
|
||||
<i class="bi bi-geo"></i> Voir sur Overpass Turbo
|
||||
</a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue