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 robe)

What steps will reproduce the problem?

  1. 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

Change History (6)

comment:1 by robe, 16 years ago

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.

comment:2 by robe, 16 years ago

<i>(No comment was entered for this change.)</i>

comment:3 by post...@…, 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

comment:4 by pramsey, 16 years ago

Applied modified version to 1.3 branch at r3966, to trunk at r3967.

comment:5 by robe, 16 years ago

Description: modified (diff)
Resolution: worksformefixed
Status: assignedclosed

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.

Note: See TracTickets for help on using tickets.