Skip to content

Commit

Permalink
Renamed wrong parameter name mitre_level to mitre_limit
Browse files Browse the repository at this point in the history
Added ST_asGeojson
Composer fix
  • Loading branch information
ahawlitschek committed Jul 31, 2023
1 parent 8914c5d commit 841faf8
Show file tree
Hide file tree
Showing 27 changed files with 644 additions and 482 deletions.
951 changes: 535 additions & 416 deletions composer.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Data/Geometries/GeometryCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class GeometryCollection extends Geometry implements Countable
/**
* @param Geometry[] $geometries
*/
public static function make(array $geometries, ?int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D): self
public static function make(array $geometries, int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D): self
{
return new self($geometries, $srid, $dimension);
}

protected function __construct(array $geometries, ?int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D)
protected function __construct(array $geometries, int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D)
{
parent::__construct($srid, $dimension);

Expand Down
2 changes: 1 addition & 1 deletion src/Data/Geometries/LineString.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class LineString extends PointCollection
/**
* @param \Clickbar\Magellan\Data\Geometries\Point[] $points
*/
public static function make(array $points, ?int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D): self
public static function make(array $points, int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D): self
{
return new self($points, $srid, $dimension);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Geometries/MultiLineString.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class MultiLineString extends Geometry implements Countable
/**
* @param LineString[] $lineStrings
*/
public static function make(array $lineStrings, ?int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D): self
public static function make(array $lineStrings, int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D): self
{
return new self($lineStrings, $srid, $dimension);
}

protected function __construct(array $lineStrings, ?int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D)
protected function __construct(array $lineStrings, int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D)
{
parent::__construct($srid, $dimension);

Expand Down
2 changes: 1 addition & 1 deletion src/Data/Geometries/MultiPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class MultiPoint extends PointCollection
/**
* @param Point[] $points
*/
public static function make(array $points, ?int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D): self
public static function make(array $points, int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D): self
{
return new self($points, $srid, $dimension);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Geometries/MultiPolygon.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ class MultiPolygon extends Geometry implements \Countable
/**
* @param Polygon[] $polygons
*/
public static function make(array $polygons, ?int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D): self
public static function make(array $polygons, int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D): self
{
return new self($polygons, $srid, $dimension);
}

/**
* @param Polygon[] $polygons
*/
protected function __construct(array $polygons, ?int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D)
protected function __construct(array $polygons, int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D)
{
parent::__construct($srid, $dimension);

Expand Down
8 changes: 4 additions & 4 deletions src/Data/Geometries/Point.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class Point extends Geometry
{
public static function make(float $x, float $y, ?float $z = null, ?float $m = null, ?int $srid = null): self
public static function make(float $x, float $y, float $z = null, float $m = null, int $srid = null): self
{
return new self(Dimension::fromCoordinates($x, $y, $z, $m), $x, $y, $z, $m, $srid);
}
Expand All @@ -15,14 +15,14 @@ public static function make(float $x, float $y, ?float $z = null, ?float $m = nu
* Creates a point instance with the WGS84 projection (SRID=4326)
* Points using this projection can also use the geodectic getters and setters
*/
public static function makeGeodetic(float $latitude, float $longitude, ?float $altitude = null, ?float $m = null): self
public static function makeGeodetic(float $latitude, float $longitude, float $altitude = null, float $m = null): self
{
$dimension = Dimension::fromCoordinates($longitude, $latitude, $altitude, $m);

return new self($dimension, $longitude, $latitude, $altitude, $m, config('magellan.geodetic_default_srid'));
}

public static function makeEmpty(?int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D): self
public static function makeEmpty(int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D): self
{
$z = null;
$m = null;
Expand All @@ -43,7 +43,7 @@ protected function __construct(
protected float $y,
protected ?float $z = null,
protected ?float $m = null,
?int $srid = null
int $srid = null
) {
parent::__construct($srid, $dimension);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Geometries/PointCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ abstract class PointCollection extends Geometry
/**
* @param Point[] $points
*/
protected function __construct(array $points, ?int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D)
protected function __construct(array $points, int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D)
{
parent::__construct($srid, $dimension);

Expand Down
2 changes: 1 addition & 1 deletion src/Data/Geometries/Polygon.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Polygon extends MultiLineString
/**
* @param LineString[] $lineStrings
*/
public static function make(array $lineStrings, ?int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D): self
public static function make(array $lineStrings, int $srid = null, Dimension $dimension = Dimension::DIMENSION_2D): self
{
return new self($lineStrings, $srid, $dimension);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Builder/BuilderUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class BuilderUtils
{
public static function buildPostgisFunction(Builder|EloquentBuilder $builder, string $bindingType, ?string $geometryType, string $function, ?string $as = null, ...$params): Expression
public static function buildPostgisFunction(Builder|EloquentBuilder $builder, string $bindingType, ?string $geometryType, string $function, string $as = null, ...$params): Expression
{
if ($builder instanceof EloquentBuilder) {
$builder = $builder->getQuery();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static function bbox(string $postgisFunction, array $params, ?GeometryTyp
return new MagellanBBoxExpression($postgisFunction, $params, $geometryType);
}

public function invoke($builder, string $bindingType, ?string $as = null): Expression
public function invoke($builder, string $bindingType, string $as = null): Expression
{
// Remove null values from params and map to the BindingValue if it is no GeoParam or Expression
$params = collect($this->params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public static function zMin($geometry): MagellanNumericExpression
*
* @see https://postgis.net/docs/ST_Expand.html
*/
public static function expand($geometry, float|Expression|\Closure|null $unitsToExpand = null, float|Expression|\Closure|null $dx = null, float|Expression|\Closure|null $dy = null, float|Expression|\Closure|null $dz = null, float|Expression|\Closure|null $dm = null): MagellanGeometryOrBboxExpression
public static function expand($geometry, float|Expression|\Closure $unitsToExpand = null, float|Expression|\Closure $dx = null, float|Expression|\Closure $dy = null, float|Expression|\Closure $dz = null, float|Expression|\Closure $dm = null): MagellanGeometryOrBboxExpression
{
if ($unitsToExpand !== null) {
return MagellanBaseExpression::geometryOrBox('ST_Expand', [GeoParam::wrap($geometry), $unitsToExpand]);
Expand Down Expand Up @@ -198,7 +198,7 @@ public static function expand($geometry, float|Expression|\Closure|null $unitsTo
*
* @see https://postgis.net/docs/ST_EstimatedExtent.html
*/
public static function estimatedExtent(string|Expression|\Closure $tableName, string|Expression|\Closure $geoColumn, string|Expression|\Closure|null $schemaName = null, bool|Expression|\Closure|null $parentOnly = null): MagellanBBoxExpression
public static function estimatedExtent(string|Expression|\Closure $tableName, string|Expression|\Closure $geoColumn, string|Expression|\Closure $schemaName = null, bool|Expression|\Closure $parentOnly = null): MagellanBBoxExpression
{
$arguments = [
$tableName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static function dWithinGeometry($geometryA, $geometryB, float|Expression|
*
* @see https://postgis.net/docs/ST_DWithin.html
*/
public static function dWithinGeography($geographyA, $geographyB, float|Expression|\Closure $distanceMeters, bool|Expression|\Closure|null $useSpheroid = null): MagellanBooleanExpression
public static function dWithinGeography($geographyA, $geographyB, float|Expression|\Closure $distanceMeters, bool|Expression|\Closure $useSpheroid = null): MagellanBooleanExpression
{
$useSpheroid = $useSpheroid ?? true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static function boundary($geometry): MagellanGeometryExpression
*
* @see https://postgis.net/docs/ST_BoundingDiagonal.html
*/
public static function boundingDiagonal($geometry, bool|Expression|\Closure|null $fits = null): MagellanGeometryExpression
public static function boundingDiagonal($geometry, bool|Expression|\Closure $fits = null): MagellanGeometryExpression
{
return MagellanBaseExpression::geometry('ST_BoundingDiagonal', [GeoParam::wrap($geometry), $fits]);
}
Expand Down
Loading

0 comments on commit 841faf8

Please sign in to comment.