Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#2845 closed defect (fixed)

Bad geometry created from ST_AddPoint

Reported by: Mike Taves Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.7
Component: postgis Version: 2.0.x
Keywords: history Cc:

Description

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.

Change History (3)

comment:1 Changed 5 years ago by pramsey

Resolution: fixed
Status: newclosed

Fixed in 2.0 at r12848, 2.1 at r12850, trunk at r12849

comment:2 Changed 5 years ago by pramsey

Milestone: PostGIS 2.0.7
Version: 2.1.x2.0.x

comment:3 Changed 5 years ago by robe

Keywords: history added
Note: See TracTickets for help on using tickets.