Skip to content

Commit

Permalink
Merge pull request #101 from ybert/feat/st-line-substring
Browse files Browse the repository at this point in the history
Add support of ST_LineSubstring
  • Loading branch information
saibotk authored Sep 17, 2024
2 parents 1af2ef4 + 08ab1a6 commit dcd4202
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased

### Added
- PostGIS ST_LineSubstring support
- PostGIS ST_LineFromEncodedPolyline support
- PostGIS ST_LineLocatePoint support

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,17 @@ public static function lineMerge($geometry, bool|Expression|\Closure|null $direc
return MagellanBaseExpression::geometry('ST_LineMerge', [GeoParam::wrap($geometry), $directed]);
}

/**
* Computes the line which is the section of the input line starting and ending at the given fractional locations. The first argument must be a LINESTRING. The second and third arguments are values in the range [0, 1] representing the start and end locations as fractions of line length. The Z and M values are interpolated for added endpoints if present.
*
*
* @see https://postgis.net/docs/ST_LineSubstring.html
*/
public static function lineSubstring($geometry, float|Expression|\Closure $startFraction, float|Expression|\Closure $endFraction, ?GeometryType $geometryType = null): MagellanGeometryExpression
{
return MagellanBaseExpression::geometry('ST_LineSubstring', [GeoParam::wrap($geometry), $startFraction, $endFraction], $geometryType);
}

/**
* Returns the smallest circle polygon that contains a geometry.
*
Expand Down

0 comments on commit dcd4202

Please sign in to comment.