[postgis-users] build a polygon from points

nicklas.aven at jordogskog.no nicklas.aven at jordogskog.no
Tue Jun 23 00:32:17 PDT 2009


About st_makeline an array is needed like this example:select st_makepolygon(ST_MakeLine(array[st_point(3, 2),st_point(2, 2),st_point(3, 3),st_point(2, 5),st_point(5, 5),st_point(3, 2)])); greetings Nicklas

2009-06-23 Caspa wrote:

Hi, thanks for that,
>those are colunm in the table : 
>
>       coord1  |     coord2    |  coord3       |  coord4      |  pol 
> ----------------------------------------------------+--------------------
>  geom_data | geom_data | geom_data | geom_data |  I WANT THIS
>
>I tried with this but didnt work;
>
>SELECT ST_MakePoly(ST_MakeLine(coord1, coord2, coord3, coord4, coord5, coord1 ) from table
>
>the problem is that I can't make i line from more than two points ( i'm using postgis v 1.3.5 and geometry ST_MakeLine(geometry[] point_array); doesn't work)
> I'm trying to figure out how to use 
>
>geometry ST_MakeLine(geometry set pointfield);
>
>but how do I build a geometry set pointfield???
>sorry...really beginner!!
>
>
>
>
>
>
>>
2009/6/22 Paragon Corporation <lr at pcorp.us>
>Andrea,
> Are those individual records or columns in the table?
>
> Take a look at ST_MakeLine, ST_MakePolygon, ST_BuildArea
>
>postgis.refractions.net/documentation/manual-svn/ST_MakeLine.html
>
>postgis.refractions.net/documentation/manual-svn/ST_BuildArea.html
>
>postgis.refractions.net/documentation/manual-svn/ST_MakePolygon.html
>
>
> You build a line from points with ST_MakeLine and then do a ST_BuildArea or
> ST_MakePolygon depending on your desired effect.
>
> Leo
>>
>
 >

>
>
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Caspa
> Sent: Monday, June 22, 2009 10:15 AM
> To: postgis-users at postgis.refractions.net
> Subject: [postgis-users] build a polygon from points
>
> Hi everybody,
> I'm new to postgis...
> how can i build a polygon starting from points and not from x,y coord?
>
> i have a table built like this:
>
> point1 | point2 | point3 | point4 | polygon
>
> guess i have to use MakeLine and MakePolygon but i can't fugure out why...
> thanks in advance
>
> Andrea
>
_______________________________________________
> postgis-users mailing list
>postgis-users at postgis.refractions.net
>postgis.refractions.net/mailman/listinfo/postgis-users
>
>
> _______________________________________________
> postgis-users mailing list
>postgis-users at postgis.refractions.net
>postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090623/3f4a3d7c/attachment.html>


More information about the postgis-users mailing list