getPlaceForFile($fileId); if ($place === null) { return; } $this->placeMapper->setPlaceForFile($place, $fileId); } public function getPlaceForFile(int $fileId): ?string { try { $metadata = $this->filesMetadataManager->getMetadata($fileId, true); } catch (FilesMetadataNotFoundException) { return null; } if (!$this->rgcService->arePlacesEnabled() || !$metadata->hasKey('photos-gps')) { return null; } $coordinate = $metadata->getArray('photos-gps'); $latitude = $coordinate['latitude'] ?? null; $longitude = $coordinate['longitude'] ?? null; if ($latitude === null || $longitude === null) { return null; } return $this->rgcService->getPlaceForCoordinates((float)$latitude, (float)$longitude); } }