Opened 10 years ago

Closed 10 years ago

#545 closed defect (invalid)

error retrieving single point linestring WKB

Reported by: ravenAtSafe Owned by: pramsey
Priority: medium Milestone: PostGIS 1.5.3
Component: postgis Version: 1.5.X
Keywords: Cc:


If you insert a single point linestring into PostGIS (via WKB, as WKT of the same geo is rejected), it can't be read back.

insert into single_point_linestring (geom) values (ST_GeomFromWKB(decode('01020000000100000000000000000008400000000000000840','hex')))
select ST_AsText(geom) from single_point_linestring

ERROR:  geometry requires more points

********** Error **********

ERROR: geometry requires more points
SQL state: XX000

Change History (6)

comment:1 Changed 10 years ago by strk

Try ST_asEWKT() or just nothing (getting canonical output). Chances are ST_AsText is being picky about what it provides, being a single-line LINESTRING non-valid OGC WKT for a line.

comment:2 Changed 10 years ago by ravenAtSafe

The following access attempts all result in the same error:

select geom from single_point_linestring select ST_AsBinary(geom) from single_point_linestring select ST_asEWKT(geom) from single_point_linestring

Maybe there is some clever cast that would prevent PostGIS from trying to interpret the geometry, but I don't know what that might be.

I am agnostic on whether PostGIS should be able to output single point linestrings - my complaint is that it is possible to insert data that cripples your dataset. I don't know how you could even identify the bad rows to remove them.

comment:3 Changed 10 years ago by strk

Are you using PostGIS 1.5.1 ? As that's where it should have been fixed.

comment:4 Changed 10 years ago by ravenAtSafe

I'm using 1.5.0 - so this has already been improved?

comment:5 Changed 10 years ago by strk

Yes. Please test for confirmation. Just 'make install', no scripts update required.

comment:6 Changed 10 years ago by pramsey

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.