[PostGIS] #5827: ST_3DDFullyWithin gives wrong result
PostGIS
trac at osgeo.org
Sun Jan 5 18:24:23 PST 2025
#5827: ST_3DDFullyWithin gives wrong result
-----------------------+---------------------------
Reporter: nbvfgh | Owner: pramsey
Type: defect | Status: new
Priority: critical | Milestone: PostGIS 3.6.0
Component: postgis | Version: 3.5.x
Resolution: | Keywords:
-----------------------+---------------------------
Comment (by nbvfgh):
Since there is currently no implementation of 3DContains or 3DWithin (at
least I haven't seen it in the documentation), I have a simple suggestion.
For ST_3DDFullyWithin (a, b, dis), you can use ST_3DClosestPoint(a. b) to
first calculate the cloest point from geometry a to geometry b, then use
ST_3DMaxDistance(p, b) to calculate the maximum distance from the point p
to geometry b, and finally compare the obtained distance with dis.
That is, ST_3DDFullyWithin (a, b, dis) <=>
ST_3DMaxDistance(ST_3DClosestPoint(a, b), b) <= dis.
The same applies to 2D.
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5827#comment:4>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list