Skip to content

Commit 7ce9b23

Browse files
committed
fixed bug in coordinates with three axes
1 parent 8862869 commit 7ce9b23

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Formatter/Specialised/JoltHttpOGMTranslator.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ private function getSRID(string $value): int
202202
}
203203

204204
/**
205-
* @return array{0: string, 1: string, 2: string} $coordinates
205+
* @return array{0: string, 1: string, 2?: string} $coordinates
206206
*/
207207
private function getCoordinates(string $value): array
208208
{
@@ -216,10 +216,11 @@ private function getCoordinates(string $value): array
216216
throw new UnexpectedValueException('Expected 3 coordinates in string: '.$value);
217217
}
218218

219-
if (count($coordinates) !== 2) {
219+
if ($matches[1] !== 'Z' && count($coordinates) !== 2) {
220220
throw new UnexpectedValueException('Expected 2 coordinates in string: '.$value);
221221
}
222222

223+
/** @var array{0: string, 1: string, 2?: string} */
223224
return $coordinates;
224225
}
225226

0 commit comments

Comments
 (0)