Opened 16 years ago
Closed 16 years ago
#146 closed defect (fixed)
1.4 ST_Distance and ST_Dwithin doesn't handle collections correctly
Reported by: | robe | Owned by: | robe |
---|---|---|---|
Priority: | critical | Milestone: | PostGIS 1.4.0 |
Component: | postgis | Version: | 1.4 |
Keywords: | Cc: |
Description (last modified by )
What steps will reproduce the problem?
- Run the below
SELECT ST_Distance(g1,g2), ST_Dwithin(g1,g2,0.01), ST_AsEWKT(g2) FROM (SELECT ST_geomFromEWKT('LINESTRING(1 2, 2 4)') As g1, ST_Collect(ST_GeomFromEWKT('LINESTRING(0 0, -1 -1)'), ST_GeomFromEWKT('MULTIPOINT(1 2,2 3)')) As g2) As foo
What is the expected output? In 1.3.5 I get this
2.23606797749979;f;GEOMETRYCOLLECTION(LINESTRING(0 0,-1 -1),MULTIPOINT(1 2,2 3)) What do you see instead? In 1.4 I get this
ERROR: Unsupported geometry type: MultiPoint
Attachments (1)
Change History (6)
comment:1 by , 16 years ago
comment:3 by , 16 years ago
Hallo
I found a bug in measures.c It could handle collections and mult as the first incomming geometry but not the second. I think this patch solves it /Nicklas Avén
by , 16 years ago
Attachment: | st_distance_bugfix.patch added |
---|
comment:5 by , 16 years ago
Description: | modified (diff) |
---|---|
Resolution: | worksforme → fixed |
Status: | assigned → closed |
This looks okay to me, but can't test against 1.3.6SVN since apparently that still crashes with curves and my 1.3.6 is very unhappy after the crash.
On closer inspection I'm guessing this is a bug we introduced when we tried to resolve the crashing bug for curved support in distance and that other cleanup thing I can't remember.
The problem seems to consistently happen in 1.4 if you have a collection that contains another geometry collection or a multi type geometry.