[postgis-users] convert circle to polygon/multilinestring geom

Michael Fuhr mike at fuhr.org
Fri Sep 8 04:04:53 PDT 2006


On Fri, Sep 08, 2006 at 10:57:13AM +0100, Donal Regan wrote:
> How can I convert postgres circle type data in the form
> ((136.415486320932,36.4781234937248),0.120176281150151)
> to a postgis geometry type data such as a polygon or multilinestring?

You could use Buffer(), optionally providing a third argument to
specify the number of segments in a quarter circle (the default
is 8):

Buffer(GeomFromText('POINT(136.415 36.478)'), 0.12)
Buffer(GeomFromText('POINT(136.415 36.478)'), 0.12, 16)

If you have a table with a circle column then you could convert it
to a geometry like this:

Buffer(MakePoint((point(col))[0], (point(col))[1]), radius(col))

-- 
Michael Fuhr



More information about the postgis-users mailing list