[postgis-devel] ST_LineToCurve output type

Paul Ramsey pramsey at cleverelephant.ca
Tue Aug 13 12:36:02 PDT 2013


On Tuesday, August 13, 2013 at 12:32 PM, Sandro Santilli wrote:
> I noticed that ST_LineToCurve returns linear-type geometries when it doesn't
> detect any curve in input. Given curved types can legitimately represent lines
> (compoundcurve only containing linestring elements) wouldn't it be more
> appropriate to always return curves ? It would make a nice invariant, IMHO.
> 
> Any reason NOT to do that ?
Because it's for un-stroking arcs, quite specifically, as your recent restriction on the kinds of inputs it would accept emphasizes. If the input is not an unstroked arc, we shouldn't muck with it. 

Take a compoundcurve. It's got arcy things in it, it's got linear things in it. Run curvetoline on it. Now it's just liney things. Now run linetocurve on it. It should now be a mixture again of liney things and curvey things.

Take a linestring. It's just liney things. Run curvetoline on it. It's still just liney things. Run linetocurve on it. It's still just liney things.

I think the current behavior makes sense.

P.



More information about the postgis-devel mailing list