mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-04 17:04:53 +02:00
add overpass query and josm
This commit is contained in:
parent
0cdb2f9ae9
commit
afc120ef2a
4 changed files with 108 additions and 2 deletions
|
@ -85,6 +85,14 @@ class FollowUpController extends AbstractController
|
|||
'label' => 'Sous-stations électriques',
|
||||
'objects' => array_filter($elements, fn($el) => ($el['tags']['power'] ?? null) === 'substation')
|
||||
],
|
||||
'laboratory' => [
|
||||
'label' => 'Laboratoires d\'analyse',
|
||||
'objects' => array_filter($elements, fn($el) => ($el['tags']['healthcare'] ?? null) === 'laboratory')
|
||||
],
|
||||
'school' => [
|
||||
'label' => 'Écoles',
|
||||
'objects' => array_filter($elements, fn($el) => ($el['tags']['amenity'] ?? null) === 'school')
|
||||
],
|
||||
];
|
||||
$now = new \DateTime();
|
||||
foreach ($types as $type => $data) {
|
||||
|
@ -130,6 +138,14 @@ class FollowUpController extends AbstractController
|
|||
$completed = array_filter($data['objects'], function($el) {
|
||||
return !empty($el['tags']['substation'] ?? null);
|
||||
});
|
||||
} elseif ($type === 'laboratory') {
|
||||
$completed = array_filter($data['objects'], function($el) {
|
||||
return !empty($el['tags']['website'] ?? null) || !empty($el['tags']['contact:website'] ?? null);
|
||||
});
|
||||
} elseif ($type === 'school') {
|
||||
$completed = array_filter($data['objects'], function($el) {
|
||||
return !empty($el['tags']['ref:UAI'] ?? null) && !empty($el['tags']['isced:level'] ?? null) && !empty($el['tags']['school:FR'] ?? null);
|
||||
});
|
||||
}
|
||||
$completion = count($data['objects']) > 0 ? round(count($completed) / count($data['objects']) * 100) : 0;
|
||||
$followupCompletion = new CityFollowUp();
|
||||
|
@ -195,6 +211,14 @@ class FollowUpController extends AbstractController
|
|||
'label' => 'Sous-stations électriques',
|
||||
'objects' => array_filter($elements, fn($el) => ($el['tags']['power'] ?? null) === 'substation')
|
||||
],
|
||||
'laboratory' => [
|
||||
'label' => 'Laboratoires d\'analyse',
|
||||
'objects' => array_filter($elements, fn($el) => ($el['tags']['healthcare'] ?? null) === 'laboratory')
|
||||
],
|
||||
'school' => [
|
||||
'label' => 'Écoles',
|
||||
'objects' => array_filter($elements, fn($el) => ($el['tags']['amenity'] ?? null) === 'school')
|
||||
],
|
||||
];
|
||||
$now = new \DateTime();
|
||||
foreach ($types as $type => $data) {
|
||||
|
@ -238,6 +262,14 @@ class FollowUpController extends AbstractController
|
|||
$completed = array_filter($data['objects'], function($el) {
|
||||
return !empty($el['tags']['substation'] ?? null);
|
||||
});
|
||||
} elseif ($type === 'laboratory') {
|
||||
$completed = array_filter($data['objects'], function($el) {
|
||||
return !empty($el['tags']['website'] ?? null) || !empty($el['tags']['contact:website'] ?? null);
|
||||
});
|
||||
} elseif ($type === 'school') {
|
||||
$completed = array_filter($data['objects'], function($el) {
|
||||
return !empty($el['tags']['ref:UAI'] ?? null) && !empty($el['tags']['isced:level'] ?? null) && !empty($el['tags']['school:FR'] ?? null);
|
||||
});
|
||||
}
|
||||
$completion = count($data['objects']) > 0 ? round(count($completed) / count($data['objects']) * 100) : 0;
|
||||
$followupCompletion = new CityFollowUp();
|
||||
|
@ -316,6 +348,14 @@ class FollowUpController extends AbstractController
|
|||
'label' => 'Sous-stations électriques',
|
||||
'objects' => array_filter($elements, fn($el) => ($el['tags']['power'] ?? null) === 'substation')
|
||||
],
|
||||
'laboratory' => [
|
||||
'label' => 'Laboratoires d\'analyse',
|
||||
'objects' => array_filter($elements, fn($el) => ($el['tags']['healthcare'] ?? null) === 'laboratory')
|
||||
],
|
||||
'school' => [
|
||||
'label' => 'Écoles',
|
||||
'objects' => array_filter($elements, fn($el) => ($el['tags']['amenity'] ?? null) === 'school')
|
||||
],
|
||||
];
|
||||
foreach ($types as $type => $data) {
|
||||
// Suivi du nombre
|
||||
|
@ -358,6 +398,14 @@ class FollowUpController extends AbstractController
|
|||
$completed = array_filter($data['objects'], function($el) {
|
||||
return !empty($el['tags']['substation'] ?? null);
|
||||
});
|
||||
} elseif ($type === 'laboratory') {
|
||||
$completed = array_filter($data['objects'], function($el) {
|
||||
return !empty($el['tags']['website'] ?? null) || !empty($el['tags']['contact:website'] ?? null);
|
||||
});
|
||||
} elseif ($type === 'school') {
|
||||
$completed = array_filter($data['objects'], function($el) {
|
||||
return !empty($el['tags']['ref:UAI'] ?? null) && !empty($el['tags']['isced:level'] ?? null) && !empty($el['tags']['school:FR'] ?? null);
|
||||
});
|
||||
}
|
||||
$completion = count($data['objects']) > 0 ? round(count($completed) / count($data['objects']) * 100) : 0;
|
||||
$followupCompletion = new CityFollowUp();
|
||||
|
|
|
@ -573,6 +573,8 @@ area["ref:INSEE"="$zone"]->.searchArea;
|
|||
nwr["man_made"="surveillance"](area.searchArea);
|
||||
nwr["amenity"="recycling"](area.searchArea);
|
||||
nwr["power"="substation"](area.searchArea);
|
||||
nwr["healthcare"="laboratory"](area.searchArea);
|
||||
nwr["amenity"="school"](area.searchArea);
|
||||
);
|
||||
out body;
|
||||
>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue