Skip to content

Commit

Permalink
Add support of ST_LineSubstring
Browse files Browse the repository at this point in the history
  • Loading branch information
ybert committed Sep 16, 2024
1 parent 8421042 commit 263ece2
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,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): MagellanGeometryExpression
{
return MagellanBaseExpression::geometry('ST_LineSubstring', [GeoParam::wrap($geometry), $startFraction, $endFraction]);
}

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

0 comments on commit 263ece2

Please sign in to comment.