Don't forget to add the first point at the end of the polygon definition (required by OGC specs). in your example, the last point (0 0 -2) is different from the first one (0 0 -1)
I understood triangle data would be in the database, in the form of column values, thus the makeline approach. Nicolas On 8 October 2012 16:39, Ed Linde <[email protected]> wrote: > Thanks Nicolas, what about something like > > ST_GeomFromText('POLYGON((0 0 -1,2 0 -2,1 2 -1 ,0 0 -2))') > > would that work? > > > On Mon, Oct 8, 2012 at 4:34 PM, Nicolas Ribot <[email protected]> > wrote: >> >> Hi, >> >> You could create triangles by calling st_makeLine and st_makePolygon: >> >> select st_makePolygon(st_makeLine('{point1, point2, point3, point1}')) >> from triangles >> (the 4 points are put in a array before calling makeLine). >> >> Yes for the Gist index on the column. >> >> Nicolas >> >> On 8 October 2012 16:03, Ed Linde <[email protected]> wrote: >> > Hi All, >> > I am looking at an easy way to load a lot of triangles into a geometry >> > column. Wondering what is the best way to >> > create a triangle when I have 3 points? Is there a function I can use? >> > Also can I just index this column with Gist and then query against a box >> > I >> > make to see what triangles intersect >> > with this rectangle? >> > >> > Cheers, >> > Ed >> > >> > _______________________________________________ >> > postgis-users mailing list >> > [email protected] >> > http://postgis.refractions.net/mailman/listinfo/postgis-users >> > >> _______________________________________________ >> postgis-users mailing list >> [email protected] >> http://postgis.refractions.net/mailman/listinfo/postgis-users > > > > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
