[postgis-devel] [PostGIS] #210: segmentation faults in lwgeom_geos.c:pgis_union_geometry_array

PostGIS trac at osgeo.org
Tue Jun 30 01:03:17 PDT 2009


#210: segmentation faults in lwgeom_geos.c:pgis_union_geometry_array
------------------------+---------------------------------------------------
  Reporter:  dfuhriman  |       Owner:  robe         
      Type:  defect     |      Status:  assigned     
  Priority:  medium     |   Milestone:  postgis 1.3.7
 Component:  postgis    |     Version:  trunk        
Resolution:             |    Keywords:               
------------------------+---------------------------------------------------
Comment (by robe):

 Mark,

 Its better but, I think its probably still flawed.  At this point I'm
 willing to accept this though since its better than what we had before and
 you have fixed the most offensive of corner cases that causes the crash --
 though I'm testing on OpenSUSE and OpenSUSE only crashes on the MakeLine
 one which you have yet to fix. That one I find more serious  because it
 even crashes my 1.3.7 installs and I have had to work around that one.

 But since we are talking about the flawedness of the ST_Union patch.
 To demonstrate:

 SELECT ST_Union(the_geom)
 FROM (SELECT CASE WHEN i%4 = 0 THEN ST_SetSRID(ST_Point(i,j),4326) ELSE
 NULL END As the_geom
 FROM generate_series(1,20) As i CROSS JOIN generate_series(-30, 40) As j)
 As foo;

 I get

 ---ERROR:  Operation on mixed SRID geometries  (but this has always been
 the case since the beginning of time but is still related to this bug I
 beleive). This is a long standing bug.

 Vs.

 SELECT ST_Union(ARRAY[ST_SetSRID(ST_Point(10,40), 4326), NULL])

 This one works fine.

 vs.

 SELECT ST_Union(ARRAY[NULL,NULL,ST_SetSRID(ST_Point(10,40), 4326), NULL])


 Does not work fine:
 ERROR:  Operation on mixed SRID geometries

 Why should one work and the other not?

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/210#comment:22>
PostGIS <http://trac.osgeo.org/postgis/>
PostGIS


More information about the postgis-devel mailing list