[postgis-devel] SnapToGrid support of circular string

Sandro Santilli strk at keybit.net
Thu Apr 14 03:18:37 PDT 2011

On Thu, Apr 14, 2011 at 10:30:16AM +0100, Mark Cave-Ayland wrote:
> On 13/04/11 21:24, Sandro Santilli wrote:
> >Does it make sense to threat a CircularString the
> >same as a LineString when it comes to snapping it
> >to a grid ?
> >
> >Adding such support would help fixing ticket #183,
> >which is a regress test failing due to precision on 32bits:
> >
> >    CIRCULARSTRING(0 0,0.500000000000184 1.20710678118655,1 0),
> >    (1 0,0 1)
> >  )
> >
> >Sorry for the lame question but I haven't found semantic
> >of CIRCULARSTRING on the postgis manual
> I think you need to consult the SQL-MM specification for this - I'm not 
> sure whether snapping should just affect control points or something else?
> Can you post a reference when you find out what the behaviour should be 
> so it is documented for the archives?

ISO 13249 aka SQL/MM - 4.1.6 ST_CircularString

More or less says this:
 The first point is the start point of the arc.
 The second point is any intermediate point on the arc.
 The third point is the end point of the arc.

So each triplet defines a curved arc, with second point possibly choosen
arbitrarely. This makes me think there might be better options than 
"closest grid cross to control point" but I'm not willing to invest much
time on researching that. I'll leave a TODO item.


  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html

More information about the postgis-devel mailing list