#5604 closed defect (fixed)
ST_Distance doesn't return the minimum distance of two geometries.
Reported by: | Wenjing | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 3.4.2 |
Component: | postgis | Version: | 3.4.x |
Keywords: | Cc: |
Description
Consider this statement:
SELECT ST_Distance(a2, a1), ST_Distance(a1, a2) FROM ST_GeomFromText('MULTIPOINT((-2 0), EMPTY)') As a1 ,ST_GeomFromText(' GEOMETRYCOLLECTION(POINT(1 0),LINESTRING(0 0,1 0))') As a2; --actual{3,2} --expected{2,2}
According to the following definition, ST_Distance returns the minimum distance between two geometries :
returns the minimum 2D Cartesian (planar) distance between two geometries
Therefore, the result of ST_Distance(a2, a1) should be the same as ST_Distance(a1, a2) which is 2. However, ST_Distance(a2, a1) returns 3, which seems to be a bug.
Version:
POSTGIS="3.5.0dev 3.4.0rc1-748-gaedf3b14f" [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"
Change History (9)
comment:1 by , 12 months ago
Milestone: | PostGIS 3.4.1 → PostGIS 3.4.2 |
---|
comment:2 by , 11 months ago
comment:7 by , 11 months ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Simple reproducer