Skip to content

Commit

Permalink
Merge pull request #22 from clickbar/buffer-geomtype-improvement
Browse files Browse the repository at this point in the history
Optional geometry type param for ST_Buffer enabling easier control ab…
  • Loading branch information
ahawlitschek authored Feb 7, 2023
2 parents cb31be7 + 48ef59a commit c33f865
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Laravel 10 support
- PHP 8.2 support

### Improved
- Optional geometry type param for ST_Buffer enabling easier control about metric buffering

### Fixed
- Typing bug when trying to use a Closure as Geoparam



## [1.0.2](https://github.com/clickbar/laravel-magellan/tree/1.0.2) - 2023-01-05

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ trait MagellanGeometryProcessingFunctions
*
* @see https://postgis.net/docs/ST_Buffer.html
*/
public static function buffer($geometry, float|Expression|\Closure $radius, ?int $numSegQuarterCircle = null, ?int $styleQuadSegs = null, ?EndCap $styleEndCap = null, ?Join $styleJoin = null, float|Expression|\Closure|null $styleMitreLevel = null, ?Side $styleSide = null): MagellanGeometryExpression
public static function buffer($geometry, float|Expression|\Closure $radius, ?int $numSegQuarterCircle = null, ?int $styleQuadSegs = null, ?EndCap $styleEndCap = null, ?Join $styleJoin = null, float|Expression|\Closure|null $styleMitreLevel = null, ?Side $styleSide = null, ?GeometryType $geometryType = null): MagellanGeometryExpression
{
$arguments = [
GeoParam::wrap($geometry),
Expand Down Expand Up @@ -65,7 +65,7 @@ public static function buffer($geometry, float|Expression|\Closure $radius, ?int
$arguments[] = $numSegQuarterCircle;
}

return MagellanBaseExpression::geometry('ST_Buffer', $arguments, null);
return MagellanBaseExpression::geometry('ST_Buffer', $arguments, $geometryType);
}

/**
Expand Down

0 comments on commit c33f865

Please sign in to comment.