[postgis-users] Converting a LineString to a CompoundCurve

Simon Greener simon at spatialdbadvisor.com
Fri Oct 7 03:58:18 PDT 2016


> I am trying to convert a LineString to a CompoundCurve.
> I was trying ST_LineToCurve(), but it seems to return again a LineString ;-(
> Casting with ::geometry(CompoundCurve,21781) doesn't work either.
> Is this impossible to do or did I miss something?
> ----------------
> The reason I want to do it, is that I have some road data which is in
> CompoundCurve type. I want to use ST_LineStubstring() on this geometry,
> so I use ST_CurveToLine(). I want to convert the result back into a
> CompoundCurve, for being able to store it in a table which has a
> constraint on CompoundCurve type.
> Thank you, if you have an idea!

I've done some work on this in the past for customers. The function looks for triplets that form a circular arc and turn them into a circular linestring.

I can see if I can dig it up if someone else has not already helped you out.

Oh, like most things spatial, can you give us an example before/after (WKT)?

Holder of "2011 Oracle Spatial Excellence Award for Education and Research."
SpatialDB Advice and Design, Solutions Architecture and Programming,
Oracle Database 10g Administrator Certified Associate; Oracle Database 10g SQL Certified Professional
Oracle Spatial, SQL Server, PostGIS, MySQL, ArcSDE, Manifold GIS, FME, Radius Topology and Studio Specialist.
39 Cliff View Drive, Allens Rivulet, 7150, Tasmania, Australia.
Website: www.spatialdbadvisor.com
   Email: simon at spatialdbadvisor.com
   Voice: +61 362 396397
Mobile: +61 418 396391
Skype: sggreener
Longitude: 147.20515 (147° 12' 18" E)
Latitude: -43.01530 (43° 00' 55" S)
GeoHash: r22em9r98wg

More information about the postgis-users mailing list