From 9143cf857d68ed1dfd92d8f06a12e07d33073f2e Mon Sep 17 00:00:00 2001 From: Gwadaking Date: Thu, 9 Apr 2026 00:46:09 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20bboxes=20pr=C3=A9cises=20par=20=C3=AEle?= =?UTF-8?q?=20(Basse-Terre,=20Grande-Terre,=20D=C3=A9sirade=20s=C3=A9par?= =?UTF-8?q?=C3=A9s),=20requ=C3=AAte=20Overpass=20=C3=A9largie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Command/ImportCoastalPointsCommand.php | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/backend/src/Command/ImportCoastalPointsCommand.php b/backend/src/Command/ImportCoastalPointsCommand.php index 54ccfaf..68e0d4f 100644 --- a/backend/src/Command/ImportCoastalPointsCommand.php +++ b/backend/src/Command/ImportCoastalPointsCommand.php @@ -22,15 +22,19 @@ class ImportCoastalPointsCommand extends Command // bbox format Overpass : sud,ouest,nord,est private const ISLANDS = [ - 'Guadeloupe' => ['bbox' => '15.7,-62.0,16.7,-60.8', 'region' => 'Guadeloupe'], - 'Martinique' => ['bbox' => '14.3,-61.3,14.9,-60.7', 'region' => 'Martinique'], - 'Sainte-Lucie' => ['bbox' => '13.7,-61.1,14.2,-60.8', 'region' => 'Sainte-Lucie'], - 'Barbade' => ['bbox' => '13.0,-59.8,13.4,-59.3', 'region' => 'Barbade'], - 'Saint-Martin' => ['bbox' => '17.8,-63.2,18.2,-62.9', 'region' => 'Saint-Martin'], - 'Dominique' => ['bbox' => '15.2,-61.5,15.7,-61.2', 'region' => 'Dominique'], - 'Saint-Barthélemy' => ['bbox' => '17.85,-62.9,17.98,-62.7', 'region' => 'Saint-Barthélemy'], - 'Marie-Galante' => ['bbox' => '15.8,-61.4,16.1,-61.1', 'region' => 'Guadeloupe'], - 'Les Saintes' => ['bbox' => '15.8,-61.7,15.9,-61.5', 'region' => 'Guadeloupe'], + // Guadeloupe : Basse-Terre + Grande-Terre séparés pour éviter que la bbox + // englobe trop de mer et rate des côtes + 'Basse-Terre' => ['bbox' => '15.82,-61.82,16.52,-61.55', 'region' => 'Guadeloupe'], + 'Grande-Terre' => ['bbox' => '15.97,-61.55,16.52,-61.07', 'region' => 'Guadeloupe'], + 'Marie-Galante' => ['bbox' => '15.83,-61.40,16.08,-61.10', 'region' => 'Guadeloupe'], + 'La Désirade' => ['bbox' => '16.27,-61.10,16.37,-60.82', 'region' => 'Guadeloupe'], + 'Les Saintes' => ['bbox' => '15.83,-61.68,15.90,-61.55', 'region' => 'Guadeloupe'], + 'Martinique' => ['bbox' => '14.38,-61.25,14.88,-60.80', 'region' => 'Martinique'], + 'Sainte-Lucie' => ['bbox' => '13.70,-61.10,14.15,-60.85', 'region' => 'Sainte-Lucie'], + 'Barbade' => ['bbox' => '13.00,-59.80,13.40,-59.40', 'region' => 'Barbade'], + 'Saint-Martin' => ['bbox' => '17.85,-63.20,18.18,-62.95', 'region' => 'Saint-Martin'], + 'Saint-Barthélemy' => ['bbox' => '17.85,-62.90,17.98,-62.78', 'region' => 'Saint-Barthélemy'], + 'Dominique' => ['bbox' => '15.20,-61.50,15.65,-61.24', 'region' => 'Dominique'], ]; public function __construct( @@ -82,7 +86,7 @@ class ImportCoastalPointsCommand extends Command foreach ($elements as $el) { $osmId = $el['type'] . '/' . $el['id']; - $osmName = $el['tags']['name'] ?? null; + $osmName = $el['tags']['name'] ?? $el['tags']['name:fr'] ?? null; if ($osmName === null) { continue; @@ -143,16 +147,24 @@ class ImportCoastalPointsCommand extends Command private function queryOverpass(string $bbox, SymfonyStyle $io): array { $query = <<