Opened 10 years ago

Closed 10 years ago

Last modified 10 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:


Found this bug here

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 by pramsey, 10 years ago

Resolution: fixed
Status: newclosed

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

comment:2 by pramsey, 10 years ago

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

comment:3 by robe, 10 years ago

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