[postgis-devel] [PostGIS] #723: ST_Intersection for geography is really messed up

PostGIS trac at osgeo.org
Mon Dec 20 05:57:32 PST 2010


#723: ST_Intersection for geography is really messed up
---------------------+------------------------------------------------------
 Reporter:  robe     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.0.0
Component:  postgis  |     Version:  trunk        
 Keywords:           |  
---------------------+------------------------------------------------------
 I suspect geography ST_Intersection might not be the problem but it is the
 first to break.  You need at least 2 records to break it.  A simple
 ST_Intersect(geog1,geog2) will not do it. So might just be memory not
 being released.

 {{{
 SELECT ST_Intersection(a.geog,
                         b.geog) As result
 FROM (VALUES (ST_GeogFromText('SRID=4326;POINT(-11.1111111 40)') ),
         (ST_GeogFromText('SRID=4326;POINT(-11.1111111 55)') ) ) As
 a(geog)
         CROSS JOIN
 ( VALUES (ST_GeogFromText('SRID=4326;POINT(-11.1111111 40)') ),
         (ST_GeogFromText('SRID=4326;POINT(-11.1111111 55)') )
          ) As b(geog);
 }}}

 -- returns
 ERROR:  Return size (40) not equal to expected size (16)!

 Same error with POINT/POLYGON, POINT/LINESTRING but polygon one seems
 especially fatal.

 -- When I do the below query 3 times, server crashes
 {{{
 SELECT ST_Intersection(geography(foo1.the_geom),
     geography(foo2.the_geom)) As result,
    ST_AsText(foo1.the_geom) As ref1_geom,
    ST_AsText(foo2.the_geom) As ref2_geom
 FROM ((SELECT ST_SetSRID(ST_Point(i,j),4326) As the_geom
   FROM (SELECT a*1.11111111 FROM generate_series(-10,50,10) As a) As i(i)
 CROSS JOIN generate_series(40,70, 15) j ORDER BY i,j )) As foo1 CROSS JOIN
 ((SELECT ST_Buffer(ST_SetSRID(ST_Point(i,j),4326), j*0.05) As the_geom
 FROM (SELECT a*1.11111111 FROM generate_series(-10,50,10) As a) As i(i)
 CROSS JOIN generate_series(40,70, 20) As j ORDER BY i, i*j, j)) As foo2
 LIMIT 2;
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/723>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list