mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-06-20 01:44:42 +02:00
style dashboard, remove bike parking in places selection
This commit is contained in:
parent
5a05cd22d1
commit
4c1a7729a1
5 changed files with 59 additions and 15 deletions
|
@ -163,21 +163,31 @@ out center tags;';
|
|||
|
||||
$places = [];
|
||||
if (isset($data['elements'])) {
|
||||
foreach ($data['elements'] as $element) {
|
||||
if (isset($element['tags'])) {
|
||||
|
||||
$email = "";
|
||||
|
||||
$places[] = [
|
||||
'id' => $element['id'],
|
||||
'type' => $element['type'],
|
||||
'name' => $element['tags']['name'] ?? '',
|
||||
'email' => $email,
|
||||
'lat' => $element['lat'] ?? null,
|
||||
'lon' => $element['lon'] ?? null,
|
||||
'tags' => $element['tags']
|
||||
];
|
||||
$batchSize = 100; // Traiter par lots de 100 éléments
|
||||
$totalElements = count($data['elements']);
|
||||
|
||||
for ($i = 0; $i < $totalElements; $i += $batchSize) {
|
||||
$batch = array_slice($data['elements'], $i, $batchSize);
|
||||
|
||||
foreach ($batch as $element) {
|
||||
if (isset($element['tags'])) {
|
||||
$email = "";
|
||||
|
||||
$places[] = [
|
||||
'id' => $element['id'],
|
||||
'type' => $element['type'],
|
||||
'name' => $element['tags']['name'] ?? '',
|
||||
'email' => $email,
|
||||
'lat' => $element['lat'] ?? null,
|
||||
'lon' => $element['lon'] ?? null,
|
||||
'tags' => $element['tags']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// Libérer la mémoire après chaque lot
|
||||
unset($batch);
|
||||
gc_collect_cycles();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue