[SCM] PostGIS branch master updated. 3.6.0rc2-473-g260127869
git at osgeo.org
git at osgeo.org
Fri Apr 17 02:00:41 PDT 2026
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via 26012786958aedb55589c0696086f7c48fc9fc46 (commit)
from 92fd4dd04a8e923ea36ad7cbce44f6cf063f7299 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 26012786958aedb55589c0696086f7c48fc9fc46
Author: Sandro Santilli <strk at kbt.io>
Date: Fri Apr 17 10:59:28 2026 +0200
Robustly return 0 as azimuth for north-bound segment
Or we can get 2PI instead of 0 on some platforms, see:
https://www.ict.inaf.it/gitlab/postgis/postgis/-/jobs/149333#L5560
diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c
index e10d60bf9..1dcdd6bd2 100644
--- a/liblwgeom/measures.c
+++ b/liblwgeom/measures.c
@@ -2461,9 +2461,19 @@ distance2d_sqr_pt_seg(const POINT2D *C, const POINT2D *A, const POINT2D *B)
int
azimuth_pt_pt(const POINT2D *A, const POINT2D *B, double *d)
{
- if (A->x == B->x && A->y == B->y)
- return LW_FALSE;
+ if (A->x == B->x )
+ {
+ if ( A->y == B->y)
+ {
+ return LW_FALSE;
+ }
+ *d = A->y < B->y ? 0.0 : M_PI;
+ return LW_TRUE;
+ }
+ /* TODO: use M_PI_2 instead of M_PI/2 ? */
*d = fmod(2 * M_PI + M_PI / 2 - atan2(B->y - A->y, B->x - A->x), 2 * M_PI);
+
+ /* TODO: convert 2*M_PI to 0 ? */
return LW_TRUE;
}
-----------------------------------------------------------------------
Summary of changes:
liblwgeom/measures.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list