PHP code to create triangles in postgis from geometry, for use with lacuna