Opened 14 years ago
Closed 14 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: |
Description
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 by , 14 years ago
comment:2 by , 14 years ago
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 by , 14 years ago
Are you using PostGIS 1.5.1 ? As that's where it should have been fixed.
comment:5 by , 14 years ago
Yes. Please test for confirmation. Just 'make install', no scripts update required.
comment:6 by , 14 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
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.