From b7f026b5f30987d1857da892041ab7f88aedc41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kr=C3=B6ll?= Date: Wed, 27 Dec 2023 11:38:27 +0100 Subject: [PATCH] Fix(st_project): Parameter not using the new enum --- CHANGELOG.md | 3 +++ .../PostgisFunctions/MagellanMeasurementFunctions.php | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 555edf0..c85af9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Fixed +- Fixed `ST_PROJECT` function not being migrated to the GeometryType enum. + ## [1.4.0](https://github.com/clickbar/laravel-magellan/tree/1.4.0) - 2023-07-02 ### Improved diff --git a/src/Database/PostgisFunctions/MagellanMeasurementFunctions.php b/src/Database/PostgisFunctions/MagellanMeasurementFunctions.php index 2b4af43..6daa953 100644 --- a/src/Database/PostgisFunctions/MagellanMeasurementFunctions.php +++ b/src/Database/PostgisFunctions/MagellanMeasurementFunctions.php @@ -66,7 +66,7 @@ public static function distance3D($geometryA, $geometryB): MagellanNumericExpres /** * Implements algorithm for computing the Fréchet distance restricted to discrete points for both geometries, based on Computing Discrete Fréchet Distance. The Fréchet distance is a measure of similarity between curves that takes into account the location and ordering of the points along the curves. Therefore it is often better than the Hausdorff distance. * - * @param float|Expression|\Closure|null $densityFrac When the optional densifyFrac is specified, this function performs a segment densification before computing the discrete Fréchet distance. The densifyFrac parameter sets the fraction by which to densify each segment. Each segment will be split into a number of equal-length subsegments, whose fraction of the total length is closest to the given fraction. + * @param float|Expression|\Closure|null $densityFrac When the optional densifyFrac is specified, this function performs a segment densification before computing the discrete Fréchet distance. The densifyFrac parameter sets the fraction by which to densify each segment. Each segment will be split into a number of equal-length subsegments, whose fraction of the total length is closest to the given fraction. * * @see https://postgis.net/docs/ST_FrechetDistance.html */ @@ -78,7 +78,7 @@ public static function distanceFrechet($geometryA, $geometryB, float|Expression| /** * Returns the Hausdorff distance between two geometries. The Hausdorff distance is a measure of how similar or dissimilar 2 geometries are. * - * @param float|Expression|\Closure|null $densityFrac The densifyFrac parameter can be specified, to provide a more accurate answer by densifying segments before computing the discrete Hausdorff distance. Each segment is split into a number of equal-length subsegments whose fraction of the segment length is closest to the given fraction. + * @param float|Expression|\Closure|null $densityFrac The densifyFrac parameter can be specified, to provide a more accurate answer by densifying segments before computing the discrete Hausdorff distance. Each segment is split into a number of equal-length subsegments whose fraction of the segment length is closest to the given fraction. * * @see https://postgis.net/docs/ST_HausdorffDistance.html */ @@ -322,7 +322,7 @@ public static function angleFromLines($lineString1, $lineString2): MagellanNumer public static function project($geography, float|Expression|\Closure $distance, $azimuth): MagellanGeometryExpression { // TODO: consider returning geometry/geography - return MagellanBaseExpression::geometry('ST_Project', [GeoParam::wrap($geography), $distance, $azimuth], 'geography'); + return MagellanBaseExpression::geometry('ST_Project', [GeoParam::wrap($geography), $distance, $azimuth], GeometryType::Geography); } /**