216 if (is_3d)
return sfcgal_point_create_from_xyz(point.
x, point.
y, point.
z);
217 else return sfcgal_point_create_from_xy(point.
x, point.
y);
223 sfcgal_geometry_t* line = sfcgal_linestring_create();
225 for (i = 0; i < pa->
npoints; i++)
230 sfcgal_linestring_add_point(line,
231 sfcgal_point_create_from_xyz(point.
x, point.
y, point.
z));
235 sfcgal_linestring_add_point(line,
236 sfcgal_point_create_from_xy(point.
x, point.
y));
246 sfcgal_geometry_t* triangle = sfcgal_triangle_create();
249 if (is_3d) sfcgal_triangle_set_vertex_from_xyz(triangle, 0, point.
x, point.
y, point.
z);
250 else sfcgal_triangle_set_vertex_from_xy (triangle, 0, point.
x, point.
y);
253 if (is_3d) sfcgal_triangle_set_vertex_from_xyz(triangle, 1, point.
x, point.
y, point.
z);
254 else sfcgal_triangle_set_vertex_from_xy (triangle, 1, point.
x, point.
y);
257 if (is_3d) sfcgal_triangle_set_vertex_from_xyz(triangle, 2, point.
x, point.
y, point.
z);
258 else sfcgal_triangle_set_vertex_from_xy (triangle, 2, point.
x, point.
y);
266 lwerror(
"ptarray_from_SFCGAL: Unknown Type");
int getPoint3dz_p(const POINTARRAY *pa, int n, POINT3DZ *point)
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
void lwerror(const char *fmt,...)
Write a notice out to the error handler.