-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Yanick Witschi <[email protected]>
- Loading branch information
1 parent
4a7fb8b
commit 54c0548
Showing
7 changed files
with
318 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Loupe\Loupe\Internal\Filter\Ast; | ||
|
||
use Location\Bounds; | ||
use Location\Coordinate; | ||
|
||
class GeoBoundingBox extends Node | ||
{ | ||
private Bounds $bbox; | ||
|
||
public function __construct( | ||
public string $attributeName, | ||
float $north, | ||
float $east, | ||
float $south, | ||
float $west, | ||
) { | ||
$this->bbox = new Bounds( | ||
new Coordinate($north, $west), | ||
new Coordinate($south, $east), | ||
); | ||
} | ||
|
||
public function getBbox(): Bounds | ||
{ | ||
return $this->bbox; | ||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
'attribute' => $this->attributeName, | ||
'north' => $this->bbox->getNorth(), | ||
'east' => $this->bbox->getEast(), | ||
'south' => $this->bbox->getSouth(), | ||
'west' => $this->bbox->getWest(), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.