<html>
<head>
        <title></title>
        
<meta content="MSHTML 6.00.6000.16850" name="GENERATOR"></meta>
</head>

<body>
        
<div align="left">of course not as aline, but as apolygon</div>
        
<div align="left">/Nicklas</div>
        
<div align="left"> </div>
        
<div align="left">select ST_PolygonFromText('POLYGON(('||st_x(p1)||' '||st_y(p1)||', '||st_x(p2)||' '||st_y(p2)||', '||st_x(p3)||' '||st_y(p3)||', '||st_x(p4)||' '||st_y(p4)||', '||st_x(p1)||' '||st_y(p1)||'))') AS apolygon from pointTable<br />
                <br />
                2009-06-23 nicklas.aven@jordogskog.no wrote:<br />
                <br />
                ></div>
        
<div align="left">ok, I missed to check aginst 1.3.x, sorry</div>>
        
<div align="left"> </div>>
        
<div align="left">this I think is a workaroud:</div>>
        
<div align="left"><br />
                > select ST_PolygonFromText('POLYGON(('||st_x(p1)||' '||st_y(p1)||', '||st_x(p2)||' '||st_y(p2)||', '||st_x(p3)||' '||st_y(p3)||', '||st_x(p4)||' '||st_y(p4)||', '||st_x(p1)||' '||st_y(p1)||'))') AS aline from punkter;</div>>
        
<div align="left"> </div>>
        
<div align="left">It's ugly  but it seems to work for me at 1.3.6 and should work on 1.3.5 as well</div>>
        
<div align="left"> </div>>
        
<div align="left">/Nicklas<br />
                ><br />
                > 2009-06-23 Caspa wrote:<br />
                ><br />
                > Yes, i saw it, but in postgis 1.3.5 geometry <b>ST_MakeLine</b>(geometry[] point_array);  is not implemented...<br />
                > ><br />
                > >gives error...<br />
                > ><br />
                > > here it is<br />
                > ><br />
                > ><br />
                > >ERROR:  function makeline(geometry[]) does not exist<br />
                > >LINE 1: SELECT MakeLine(ARRAY[MakePoint(1,2,3),MakePoint(3,4,5), Mak...<br />
                > ><br />
                > >you can check it here (just above example title)<br />
                > ><br />
                > ><a href="http://postgis.refractions.net/documentation/manual-svn/ST_MakeLine.html">postgis.refractions.net/documentation/manual-svn/ST_MakeLine.html</a><br />
                > ><br />
                > >></div>>
        
<div>2009/6/23 <<a>nicklas.aven@jordogskog.no</a>><br />
                > > ></div>>
        
<div>> >
                
<div align="left">ok</div>> >
                
<div align="left"> </div>> >
                
<div align="left">you saw my second answer?</div>> >
                
<div align="left">st_makeline should work if you just define an apoint array like</div>> >
                
<div align="left">array[point1, point2,point2, point1]</div>> >
                
<div align="left"> </div>> >
                
<div align="left">/Nicklas> >
                        
<div>> >
                                
<div> </div>> >
                                
<div><br />
                                        > ><br />
                                        > > 2009-06-23 Caspa wrote:<br />
                                        > ><br />
                                        > > yeah this could be the solution...unfortunately I have postgis version 1.3.5 and i doesn't have this feature yet..(I'm on debian system and don't want to build from source)<br />
                                        > > ><br />
                                        > > ><br />
                                        > > >>SELECT ST_MakePoly(ST_></div></div></div>> >
                
<div>> >
                        
<div> </div>> >
                        
<div>> >
                                
<div>>LineFromMultiPoint(ST_collect(coord1, coord2, coord3, coord4, coord5, coord1 ))) from table</div><br />
                                > > >this doesn't work, but I'm trying to use LineFromMultiPoint in other ways...maybe it works...<br />
                                > > ><br />
                                > > >THANKS <br />
                                > > ><br />
                                > > >SELECT ST_MakePoly(ST_> > >
                                
<div>LineFromMultiPoint(ST_collect(coord1, coord2, coord3, coord4, coord5, coord1 ))) from table<br />
                                        > > ><br />
                                        > > ></div><br />
                                > > >> > >
                                
<div>2009/6/23 <<a>nicklas.aven@jordogskog.no</a>><br />
                                        > > > > > >
                                        
<div>> > >
                                                
<div align="left">About st_makeline an array is needed like this example:</div>> > >
                                                
<div align="left">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)]));</div>> > >
                                                
<div align="left"> </div>> > >
                                                
<div align="left">greetings </div>> > >
                                                
<div align="left">Nicklas> > >
                                                        
<div>> > >
                                                                
<div> </div>> > >
                                                                
<div><br />
                                                                        > > ><br />
                                                                        > > > 2009-06-23 Caspa wrote:<br />
                                                                        > > ><br />
                                                                        > > > Hi, thanks for that,<br />
                                                                        > > > >those are colunm in the table : <br />
                                                                        > > > ><br />
                                                                        > > > >       coord1  |     coord2    |  coord3       |  coord4      |  pol <br />
                                                                        > > > > ----------------------------------------------------+--------------------<br />
                                                                        > > > >  geom_data | geom_data | geom_data | geom_data |  I WANT THIS<br />
                                                                        > > > ><br />
                                                                        > > > >I tried with this but didnt work;<br />
                                                                        > > > ><br />
                                                                        > > > >SELECT ST_MakePoly(ST_MakeLine(coord1, coord2, coord3, coord4, coord5, coord1 ) from table<br />
                                                                        > > > ><br />
                                                                        > > > >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 <b>ST_MakeLine</b>(geometry[] point_array); doesn't work)<br />
                                                                        > > > > I'm trying to figure out how to use <br />
                                                                        > > > ><br />
                                                                        > > > >geometry <b>ST_MakeLine</b>(geometry set pointfield);<br />
                                                                        > > > ><br />
                                                                        > > > >but how do I build a geometry set pointfield???<br />
                                                                        > > > >sorry...really beginner!!<br />
                                                                        > > > ><br />
                                                                        > > > ><br />
                                                                        > > > ><br />
                                                                        > > > ><br />
                                                                        > > > ><br />
                                                                        > > > ><br />
                                                                        > > > >></div></div></div>> > >
                                                
<div>> > >
                                                        
<div> </div>> > >
                                                        
<div>> > >
                                                                
<div>2009/6/22 Paragon Corporation <<a>lr@pcorp.us</a>><br />
                                                                        > > > >Andrea,<br />
                                                                        > > > > Are those individual records or columns in the table?<br />
                                                                        > > > ><br />
                                                                        > > > > Take a look at ST_MakeLine, ST_MakePolygon, ST_BuildArea<br />
                                                                        > > > ><br />
                                                                        > > > ><a href="http://postgis.refractions.net/documentation/manual-svn/ST_MakeLine.html" target="_blank">postgis.refractions.net/documentation/manual-svn/ST_MakeLine.html</a><br />
                                                                        > > > ><br />
                                                                        > > > ><a href="http://postgis.refractions.net/documentation/manual-svn/ST_BuildArea.html" target="_blank">postgis.refractions.net/documentation/manual-svn/ST_BuildArea.html</a><br />
                                                                        > > > ><br />
                                                                        > > > ><a href="http://postgis.refractions.net/documentation/manual-svn/ST_MakePolygon.html" target="_blank">postgis.refractions.net/documentation/manual-svn/ST_MakePolygon.html</a><br />
                                                                        > > > ><br />
                                                                        > > > ><br />
                                                                        > > > > You build a line from points with ST_MakeLine and then do a ST_BuildArea or<br />
                                                                        > > > > ST_MakePolygon depending on your desired effect.<br />
                                                                        > > > ><br />
                                                                        > > > > Leo<br />
                                                                        > > > >></div>> > >
                                                                
<div>> > > >
                                                                        
<div> </div>> > > >
                                                                        
<div><br />
                                                                                > > > ><br />
                                                                                > > > ><br />
                                                                                > > > > -----Original Message-----<br />
                                                                                > > > > From: <a>postgis-users-bounces@postgis.refractions.net</a><br />
                                                                                > > > > [mailto:<a>postgis-users-bounces@postgis.refractions.net</a>] On Behalf Of Caspa<br />
                                                                                > > > > Sent: Monday, June 22, 2009 10:15 AM<br />
                                                                                > > > > To: <a>postgis-users@postgis.refractions.net</a><br />
                                                                                > > > > Subject: [postgis-users] build a polygon from points<br />
                                                                                > > > ><br />
                                                                                > > > > Hi everybody,<br />
                                                                                > > > > I'm new to postgis...<br />
                                                                                > > > > how can i build a polygon starting from points and not from x,y coord?<br />
                                                                                > > > ><br />
                                                                                > > > > i have a table built like this:<br />
                                                                                > > > ><br />
                                                                                > > > > point1 | point2 | point3 | point4 | polygon<br />
                                                                                > > > ><br />
                                                                                > > > > guess i have to use MakeLine and MakePolygon but i can't fugure out why...<br />
                                                                                > > > > thanks in advance<br />
                                                                                > > > ><br />
                                                                                > > > > Andrea<br />
                                                                                > > > ></div></div>> > >
                                                                
<div>_______________________________________________<br />
                                                                        > > > > postgis-users mailing list<br />
                                                                        > > > ><a>postgis-users@postgis.refractions.net</a><br />
                                                                        > > > ><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">postgis.refractions.net/mailman/listinfo/postgis-users</a><br />
                                                                        > > > ><br />
                                                                        > > > ><br />
                                                                        > > > > _______________________________________________<br />
                                                                        > > > > postgis-users mailing list<br />
                                                                        > > > ><a>postgis-users@postgis.refractions.net</a><br />
                                                                        > > > ><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">postgis.refractions.net/mailman/listinfo/postgis-users</a><br />
                                                                        > > > ></div><br />
                                                                > > > > </div></div></div><br />
                                        > > >_______________________________________________<br />
                                        > > > postgis-users mailing list<br />
                                        > > ><a>postgis-users@postgis.refractions.net</a><br />
                                        > > ><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">postgis.refractions.net/mailman/listinfo/postgis-users</a><br />
                                        > > ><br />
                                        > > ></div><br />
                                > > > </div></div></div>>
        
<div><br />
                > >_______________________________________________<br />
                > > postgis-users mailing list<br />
                > ><a>postgis-users@postgis.refractions.net</a><br />
                > ><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">postgis.refractions.net/mailman/listinfo/postgis-users</a><br />
                > ><br />
                > ></div><br />
        > > 
</body>
</html>