[postgis-users] Make a polygon

Andrew Libby alibby at xforty.com
Mon Nov 5 06:41:47 PST 2012



Hi Ed,

I'd probably marshal them into MULTIPOINT and
then get the convex hull of that, something
like:

SELECT ST_AsEWKT(
   ST_ConvexHull(
     ST_GeomFromEWKT(
       'MULTIPOINT((0 0 1), (3 5 3), (9 2 2))')));


              st_asewkt
------------------------------------
  POLYGON((0 0 1,3 5 3,9 2 2,0 0 1))


Best,

Andy

On 11/2/12 4:59 AM, Ed Linde wrote:
> Hi All,
> I have 3D points generated from a script and I want to
> compute a convex hull over these
> points to make a polygon. Wondering how I can get these
> points in?
> Is this a geometry collection or is MULTIPOINT?
> I need to basically build this SQL in my script and add in
> all these points.
>
> Cheers,
> Ed.
>
>
> Format of my points:
>
>            {
>              'sy' => '83.8422270354043',
>              'sz' => '820.463109185838',
>              'sx' => '16.1577729645957'
>            },
>            {
>              'sy' => '84.0763234092944',
>              'sz' => '820.369470636282',
>              'sx' => '15.9236765907056'
>            },
>            {
>              'sy' => '84.0763234092944',
>              'sz' => '820.369470636282',
>              'sx' => '15.9236765907056'
>            },
>            {
>              'sy' => '84.0763234092944',
>              'sz' => '820.369470636282',
>              'sx' => '15.9236765907056'
>            }
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>

-- 

Andrew Libby
xforty technologies
http://xforty.com
alibby at xforty.com
484-887-7505 x 1115



More information about the postgis-users mailing list