Ticket #146 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

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) (diff)

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?

Attachments

Change History

Changed 4 years ago by robe

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.

Changed 4 years ago by robe

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

Changed 4 years ago by post...@…

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

Changed 4 years ago by pramsey

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

Changed 4 years ago by robe

  • status changed from assigned to closed
  • resolution changed from worksforme to fixed
  • description modified (diff)

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.