[postgis-users] Creating a circle geometry

strk at refractions.net strk at refractions.net
Wed Feb 16 08:12:18 PST 2005


On Wed, Feb 16, 2005 at 11:05:35AM -0500, Surridge, Christopher S wrote:
> I have the cvs version of postgis working on Solaris 10 now (thanks strk) and I'm trying to figure out how to insert a circle geometry. I have data that consists of a center given as a latitude/longitude and a radius in meters. There is a createCircle method in GEOS, but I can't figure out how to use it through postgis. Even if I could, looking through the code for createCircle, I'm not sure it will give the desired results for a lat/long coordinate system. I would settle for a bounding box created using expand, but I have the same concerns about the coordinate system in this case. Is there an easy way to do this that I'm missing, or do I just have to suck it up and do the meters to degrees and spherical coordinates math myself?

There is no postgis interface to GEOS createCircle.
If there was, or you settle to use bounding box,
you could try creating the geom in a isometric
projection and then transform it back to lat/long.
Also, consider incrementing the number of vertexes
when doing so, to get better curves at transform
time - see segmentize().

--strk;

> 
> Thanks,
> 
> --chris
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list