Skip to content

Commit

Permalink
fix: publication capabilities et métadonnées WMS-raster/WMTS #470
Browse files Browse the repository at this point in the history
  • Loading branch information
ocruze committed Oct 23, 2024
1 parent 4596d53 commit df9afe1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 14 additions & 2 deletions src/Controller/Entrepot/PyramidRasterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,13 @@ public function addWmsRasterWmts(

// Création ou mise à jour du capabilities
try {
if (ConfigurationTypes::WMSRASTER === $configuration['type'] || StoredDataTypes::ROK4_PYRAMID_RASTER === $pyramid['type']) {
if (ConfigurationTypes::WMSRASTER === $configuration['type']) {
$this->capabilitiesService->createOrUpdate($datastoreId, $endpoint, $offering['urls'][0]['url']);
} elseif (ConfigurationTypes::WMTSTMS === $configuration['type'] && StoredDataTypes::ROK4_PYRAMID_RASTER === $pyramid['type']) {
$offeringUrl = array_values(array_filter($offering['urls'], fn ($url) => 'WMTS' === $url['type']))[0] ?? null;
if (null !== $offeringUrl) {
$this->capabilitiesService->createOrUpdate($datastoreId, $endpoint, $offeringUrl['url']);
}
}
} catch (\Exception $e) {
}
Expand Down Expand Up @@ -227,7 +232,14 @@ public function editWmsRasterWmts(

// Création ou mise à jour du capabilities
try {
$this->capabilitiesService->createOrUpdate($datastoreId, $endpoint, $offering['urls'][0]['url']);
if (ConfigurationTypes::WMSRASTER === $configuration['type']) {
$this->capabilitiesService->createOrUpdate($datastoreId, $endpoint, $offering['urls'][0]['url']);
} elseif (ConfigurationTypes::WMTSTMS === $configuration['type'] && StoredDataTypes::ROK4_PYRAMID_RASTER === $pyramid['type']) {
$offeringUrl = array_values(array_filter($offering['urls'], fn ($url) => 'WMTS' === $url['type']))[0] ?? null;
if (null !== $offeringUrl) {
$this->capabilitiesService->createOrUpdate($datastoreId, $endpoint, $offeringUrl['url']);
}
}
} catch (\Exception $e) {
}

Expand Down
2 changes: 0 additions & 2 deletions src/Services/CapabilitiesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ public function createOrUpdate(string $datastoreId, array $endpoint, string $url
$annexe = $this->annexeApiService->add($datastoreId, $filePath, [$path], ['type=capabilities']);
}

$this->fs->remove($filePath);

return $annexe;
}

Expand Down

0 comments on commit df9afe1

Please sign in to comment.