From 648f7e7659c0a7358e8cf13940b7a155eafbec5a Mon Sep 17 00:00:00 2001 From: Yohann Berthon Date: Mon, 16 Sep 2024 16:39:06 +0200 Subject: [PATCH] Add support of ST_LineFromEncodedPolyline --- .../MagellanGeometryConstructorFunctions.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Database/PostgisFunctions/MagellanGeometryConstructorFunctions.php b/src/Database/PostgisFunctions/MagellanGeometryConstructorFunctions.php index 1f35d40..5e3833e 100644 --- a/src/Database/PostgisFunctions/MagellanGeometryConstructorFunctions.php +++ b/src/Database/PostgisFunctions/MagellanGeometryConstructorFunctions.php @@ -29,4 +29,15 @@ public static function collect($geometryArrayOrSet): MagellanGeometryExpression { return MagellanBaseExpression::geometry('ST_Collect', [GeoParam::wrap($geometryArrayOrSet)]); } + + /** + * Creates a LineString from an Encoded Polyline string. + * + * + * @see https://postgis.net/docs/ST_LineFromEncodedPolyline.html + */ + public static function lineFromEncodedPolyline(string|Expression|\Closure $polyline, float|Expression|\Closure|null $precision = null): MagellanGeometryExpression + { + return MagellanBaseExpression::geometry('ST_LineFromEncodedPolyline', [$polyline, $precision]); + } }