#2412 closed defect (fixed)
st_linetocurve('LINESTRING(0 0, 10 0)') -- ERROR: pta_desegmentize needs implementation for npoints < 4
Reported by: | strk | Owned by: | strk |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.0.4 |
Component: | postgis | Version: | 1.5.X |
Keywords: | history | Cc: |
Description
It looks like you can't convert a 2-points line to a curve, but the message is not friendly:
ERROR: pta_desegmentize needs implementation for npoints < 4
Should the code aim to return a COMPOUNDCURVE containing a single linestring in these cases ? That's what would cleanly convert back to the original input
Affected versions from 1.5.x to 2.2
Change History (5)
comment:1 by , 11 years ago
Type: | defect → enhancement |
---|
comment:2 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Type: | enhancement → defect |
On a second thought, this isn't really an enhancement, because ST_LineToCurve already returns non-curved elements as straight lines, and this case is not different. So the correct answer here would be to return a LINESTRING (same as the input).
comment:3 by , 11 years ago
For comparison, this works fine:
=# select st_astext(st_linetocurve('LINESTRING(0 0, 10 0, 20 0, 30 0)')); st_astext -------------------------------- LINESTRING(0 0,10 0,20 0,30 0) (1 row)
comment:4 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:5 by , 11 years ago
Keywords: | history added |
---|
Note:
See TracTickets
for help on using tickets.
This is actually an enhancement