[postgis-users] what is the units of distance parameter in the buffer function

Michael Fuhr mike at fuhr.org
Sat Dec 2 09:38:00 PST 2006


On Sat, Dec 02, 2006 at 10:08:02PM +0530, Sandeep Kumar Jakkaraju wrote:
> what is the units of distance parameter in the buffer function  ...
> 
> buffer(geom,distance,[integer])   ---> buffer(GEOMFROMTEXT('POINT(28.0 79.0
> )'),1);
> 
> if my geom is in lat/lon ..... how much will be 1 !!

The distance is in the same units as the geometry; for lat/lon
that's degrees.  A distance of 1 will therefore create a buffer
of 1 degree around the point.

Note that geometries are (X Y), which is (longitude latitude).  The
above geometry is 79N 28E, which is in the Svalbard Archipelago in
the Arctic Ocean.  If you meant 28N 79E in northern India then use
POINT(79.0 28.0).

> can some one throw more light on the 3 rd optional parameter !!! the manual
> is not clear !!

"The optional third parameter sets the number of segment used to
approximate a quarter circle (defaults to 8)."

For a point Buffer() returns a polygon that approximates a circle.
By default Buffer() uses 8 segments per quarter circle, so the
"circle" is really a 32-sided polygon.  You can increase the number
of segments to create a polygon that's closer to being a circle.

-- 
Michael Fuhr



More information about the postgis-users mailing list