152 is_3d = sfcgal_geometry_is_3d(geom);
154 #if POSTGIS_SFCGAL_VERSION >= 10308
155 is_measured = sfcgal_geometry_is_measured(geom);
158 switch (sfcgal_geometry_type_id(geom))
160 case SFCGAL_TYPE_POINT: {
162 point.
x = sfcgal_point_x(geom);
163 point.
y = sfcgal_point_y(geom);
166 point.
z = sfcgal_point_z(geom);
170 #if POSTGIS_SFCGAL_VERSION >= 10308
172 point.
m = sfcgal_point_m(geom);
179 case SFCGAL_TYPE_LINESTRING: {
180 npoints = sfcgal_linestring_num_points(geom);
183 for (i = 0; i < npoints; i++)
185 const sfcgal_geometry_t *pt = sfcgal_linestring_point_n(geom, i);
186 point.
x = sfcgal_point_x(pt);
187 point.
y = sfcgal_point_y(pt);
190 point.
z = sfcgal_point_z(pt);
194 #if POSTGIS_SFCGAL_VERSION >= 10308
196 point.
m = sfcgal_point_m(pt);
204 case SFCGAL_TYPE_TRIANGLE: {
207 for (i = 0; i < 4; i++)
209 const sfcgal_geometry_t *pt = sfcgal_triangle_vertex(geom, (i % 3));
210 point.
x = sfcgal_point_x(pt);
211 point.
y = sfcgal_point_y(pt);
214 point.
z = sfcgal_point_z(pt);
218 #if POSTGIS_SFCGAL_VERSION >= 10308
220 point.
m = sfcgal_point_m(pt);
230 lwerror(
"ptarray_from_SFCGAL: Unknown Type");
POINTARRAY * ptarray_construct(char hasz, char hasm, uint32_t npoints)
Construct an empty pointarray, allocating storage and setting the npoints, but not filling in any inf...
void ptarray_set_point4d(POINTARRAY *pa, uint32_t n, const POINT4D *p4d)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.