Opened 8 years ago

Closed 8 years ago

#3702 closed defect (fixed)

ST_LineToCurve not working as documented

Reported by: mkuhn Owned by: robe
Priority: medium Milestone: PostGIS 2.3.3
Component: documentation Version: 2.3.x
Keywords: Cc:

Description

The examples from the postgis documentation and the result of my local installation do not behave the same way.

Documentation says:

-- 3D example
SELECT ST_AsEWKT(ST_LineToCurve(ST_GeomFromEWKT('LINESTRING(1 2 3, 3 4 8, 5 6 4, 7 8 4, 9 10 4)')));

			 st_asewkt
------------------------------------
 CIRCULARSTRING(1 2 3,5 6 4,9 10 4)

My local installation does:

-- 3D example
SELECT ST_AsEWKT(ST_LineToCurve(ST_GeomFromEWKT('LINESTRING(1 2 3, 3 4 8, 5 6 4, 7 8 4, 9 10 4)')));

			 st_asewkt
------------------------------------
"LINESTRING(1 2 3,3 4 8,5 6 4,7 8 4,9 10 4)"
SELECT postgis_version()

"2.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1"

Am I misunderstanding something?

Change History (4)

comment:1 by robe, 8 years ago

No you are not misunderstanding. I get the same answer you do on my 2.3

I think something changed between now and when the example was done. I suspect that example was done pre-2.0.

As luck would have it, I have a PostGIS 1.5 install sitting around and confirmed the answer agrees with what's in the docs, but not my PostGIS 2.3 answer.

It doesn't quite make sense to me that a perfect circle can be approximated with such few points, so I'm guessing the approximation changed to be less forgiving and more accurate.

For example this works:

SELECT ST_AsText(ST_LineToCurve(ST_Translate(ST_Force3D(ST_Boundary(ST_Buffer(ST_Point(1,3), 10))),0,0,3)))


CIRCULARSTRING Z (11 3 3,-9 2.99999999999997 3,11 3 3)

comment:2 by robe, 8 years ago

Component: postgisdocumentation
Owner: changed from pramsey to robe

comment:3 by robe, 8 years ago

In 15454:

Update 3D example and put a note about function may return the same geometry.
References #3702 for PostGIS 2.4 (trunk)

comment:4 by robe, 8 years ago

Resolution: fixed
Status: newclosed

In 15455:

Update 3D example and put a note about function may return the same geometry.
References #3702 for PostGIS 2.4 (trunk)
Last commit was for PostGIS 2.3.3 (mistakenly noted as 2.4)
Closes #3702

Note: See TracTickets for help on using tickets.