<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">ST_Distance native to PostGIS has a number of performance benefits that delegating to GEOS will run afoul of<div><br></div><div>- we can look directly at the data as stored in the database, with no copy, using getPoint_cp, that’s a performance win</div><div>- in addition to a copy overhead to get to GEOS memory space, we also pay an object instantiation penalty to construct a GEOSPoint</div><div>- for larger and disjoint objects, the native PostGIS implementation has an optimized calculation that gets cost down to O(n log(n)) time </div><div><br></div><div>As I note in the ticket, I’m a hard -1 on tossing those advantages, unless I can be shown to be wrong about performance. Better to work the robustness stuff from first principles than to throw away the above.</div><div><br></div><div>P<br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Sep 26, 2024, at 3:20 AM, Sandro Santilli <noreply@osgeo.org> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="webkit-block-placeholder"></div><p dir="auto" style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">Fixes a robustness problem in Topology and doesn't trigger any<br>failure in existing teststsuite.</p><p dir="auto" style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">References<span class="Apple-converted-space"> </span><a href="https://trac.osgeo.org/postgis/ticket/5782" class="ref-issue ref-external-issue" rel="nofollow">#5782</a></p><div style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="webkit-block-placeholder"></div><div class="footer" style="font-size: small; color: rgb(102, 102, 102); font-family: HelveticaNeue; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><p>---<br><a href="https://git.osgeo.org/gitea/postgis/postgis/pulls/218">View it on OSGeo Git Services: Gitea - Git with a cup of tea</a>.</p></div></div></blockquote></div><br></div></body></html>