Skip to content

Latest commit

 

History

History
33 lines (31 loc) · 1.2 KB

10.md

File metadata and controls

33 lines (31 loc) · 1.2 KB

Consider the following statement

SELECT ST_3DDistance(b1, b2)  
FROM ST_GeomFromText('LINESTRING Z (0 0 0, 1 0 0)') As b1,
ST_GeomFromText('LINESTRING Z (0 0 0, 1 1 1)') As b2;
--  st_3ddistance 
---------------
--              
-- (1 row)
  1. The ST_3DDistance function is expected to give the result but it doesn't.
  2. It seems ST_3DDistance has an impact on other functions, such as ST_3DDWithin.
SELECT ST_3DDWithin(b1, b2, 100000)  
FROM ST_GeomFromText('LINESTRING Z (0 0 0, 1 0 0)') As b1,
ST_GeomFromText('LINESTRING Z (0 0 0, 1 1 1)') As b2;
--expected{t}, actual{f}

The distance between two geometries is 0, so the 3DDWithin should return true due to the definition:

Returns true if the 3D distance between two geometry values is no larger than distance distance_of_srid.

version: POSTGIS="3.5.0dev 3.4.0rc1-705-g5c3ec8392" [EXTENSION] PGSQL="170" GEOS="3.13.0dev-CAPI-1.18.0" PROJ="8.2.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/share/proj/proj.db" LIBXML="2.9.13" PostgreSQL 17devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0- 1ubuntu1~22.04) 11.4.0, 64-bit