From a2b355af9a27987ffb9a273723d594ed7f28f325 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Tue, 23 Jan 2024 14:01:58 -0800 Subject: [PATCH] Do full ring check always in line/poly maxdist mode, references #5639 --- NEWS | 1 + liblwgeom/measures.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 5b011fda57d..26a3b195fce 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ xxxx/xx/xx - #5635, Handle NaN points in ST_Split (Regina Obe) - #5646, Crash on collections with empty members (Paul Ramsey) - #5580, Handle empty collection components in 3d distance (Paul Ramsey) + - #5639, ST_DFullyWithin line/poly error case (Paul Ramsey) PostGIS 3.0.10 diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c index 2484e9d168d..ac2ddac4690 100644 --- a/liblwgeom/measures.c +++ b/liblwgeom/measures.c @@ -742,7 +742,7 @@ lw_dist2d_line_poly(LWLINE *line, LWPOLY *poly, DISTPTS *dl) const POINT2D *pt = getPoint2d_cp(pa, 0); /* Line has a pount outside poly. Check distance to outer ring only. */ - if (ptarray_contains_point(poly->rings[0], pt) == LW_OUTSIDE) + if (ptarray_contains_point(poly->rings[0], pt) == LW_OUTSIDE || dl->mode == DIST_MAX) return lw_dist2d_ptarray_ptarray(pa, poly->rings[0], dl); for (uint32_t i = 1; i < poly->nrings; i++)