Skip to content

Commit

Permalink
ST_3DDistance error for shared first point, references #5589
Browse files Browse the repository at this point in the history
  • Loading branch information
pramsey committed Feb 29, 2024
1 parent 8ec72f9 commit 4425662
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ xxxx/xx/xx

* Bug Fixes *

- #5589, ST_3DDistance error for shared first point (Paul Ramsey)


PostGIS 3.1.11
2024/02/06
Expand Down
7 changes: 7 additions & 0 deletions liblwgeom/measures3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,13 @@ lw_dist3d_seg_seg(POINT3DZ *s1p1, POINT3DZ *s1p2, POINT3DZ *s2p1, POINT3DZ *s2p2
dl->twisted = ((dl->twisted) * (-1));
return lw_dist3d_pt_seg(s2p1, s1p1, s1p2, dl);
}
/*s2p1 and s1p1 are the same point */
if ((s2p1->x == s1p1->x) && (s2p1->y == s1p1->y) && (s2p1->z == s1p1->z))
{
dl->distance = 0.0;
dl->p1 = dl->p2 = *s2p1;
return LW_TRUE;
}

/*
Here we use algorithm from softsurfer.com
Expand Down

0 comments on commit 4425662

Please sign in to comment.