[postgis-users] Buffer() Arc Tolerance

Paul Ramsey pramsey at refractions.net
Wed Oct 13 10:34:24 PDT 2004


Richard_D_Levine at raytheon.com wrote:

> Forgive me for using the O word, but my application is currently using
> Oracle Spatial, and I want to try it out on PostGIS.  Oracle Spatial's
> Buffer() function (Make_Buffer_Polygon()) takes arc tolerance as a
> parameter.  For a point, it scribes a equal-sided polygon inside the circle
> described by the point and buffer distance (radius).  The arc tolerance is
> the farthest distance from any side of the polygon to the circumference of
> the (imaginary) circle.  The number of points in the returned polygon from
> Oracle is determined by the radius of the circle and the arc tolerance.

I see. I don't know if I like the way Oracle has exposed that particular 
knob (seems needlessly obfuscating the underlying action, which is the 
creation of N edges to approximate the arc). However, I can see that the 
occasional lunatic user (*cough*) might actually need to twiddle it.

>>From what you said below, it appears that the PostGIS Buffer() will return
> an octagon.  Is that correct?

No, as Martin noted, the parameter refers to the number of segments per 
90 degrees, so applying it circularly, you will get an icosidodecagon (I 
love the internet). http://www.google.com/search?q=icosidodecagon

> It appears I've hit a snag, because I need to construct arbitrarily complex
> polygons by taking the union of buffer polygons around points and
> (multi)lines.
> 
> Any ideas?

We can add a parameter to the Buffer() postgis exposes easily enough, 
since GEOS/JTS allows this parameter to be modified.

Paul

> For nitty gritty the details, sometime you have to "use the source, Luke".
> 
>  From PostGIS source:
> 
>      Geometry *g3 = g1->buffer(width);
> 
> So, PostGIS is not defining a stroke angle, or using anything other than
> the defaults, it's the GEOS code which is controlling what is done.
> 
> Hitting the GEOS code, source/operation/buffer is the place to go, but
> the documentation of DEFAULT_QUADRANT_SEGMENTS seems a bit thin. I can
> tell you that the default is 8, which is what PostGIS uses.
> 
> What do you mean by the arc tolerance? The number of vertices used to
> approximate the circular structure?
> 
> Richard_D_Levine at Raytheon.com wrote:
> 
>>If I use Buffer() on a point to approximate a geodetic circle, how do I
>>determine the arc tolerance of the returned polygon to the circle?
>>
>>Is there any documentation that contains answers to questions like this?
>>I've read the PostGIS documentation cover to cover and the function
>>explanations are at a very high level (mostly copied from the OGC spec.)




More information about the postgis-users mailing list