[postgis-tickets] [PostGIS] #2845: Bad geometry created from ST_AddPoint

PostGIS trac at osgeo.org
Thu Jul 17 23:14:14 PDT 2014


#2845: Bad geometry created from ST_AddPoint
---------------------+------------------------------------------------------
 Reporter:  mwtoews  |       Owner:  pramsey
     Type:  defect   |      Status:  new    
 Priority:  medium   |   Milestone:         
Component:  postgis  |     Version:  2.1.x  
 Keywords:           |  
---------------------+------------------------------------------------------
 Found this bug here http://stackoverflow.com/q/24812031/327026

 Simplified as:
 {{{
 drop table bug;
 create table bug(geom geometry(LineString));
 insert into bug(geom) values('LINESTRING(0 0, 1 1)');
 update bug set geom = ST_AddPoint(geom, 'POINT(3 3)');

 select ST_Intersects(geom, box), ST_Intersects(geom::text::geometry, box)
 from bug, (
   select 'POLYGON ((2 2, 2 4, 4 4, 4 2, 2 2))'::geometry AS box
  ) AS foo;
 }}}
 with nonsense results, which should both be TRUE:
 {{{
  st_intersects | st_intersects
 ---------------+---------------
  f             | t
 }}}

 Note that using ST_MakeLine in place of ST_AddPoint in the above update
 query has expected results.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2845>
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-tickets mailing list