137 switch (sfcgal_geometry_type_id(geom))
139 case SFCGAL_TYPE_POINT:
142 point.
x = sfcgal_point_x(geom);
143 point.
y = sfcgal_point_y(geom);
145 if (sfcgal_geometry_is_3d(geom))
146 point.
z = sfcgal_point_z(geom);
154 case SFCGAL_TYPE_LINESTRING:
156 npoints = sfcgal_linestring_num_points(geom);
159 for (i = 0; i < npoints; i++)
161 const sfcgal_geometry_t *pt = sfcgal_linestring_point_n(geom, i);
162 point.
x = sfcgal_point_x(pt);
163 point.
y = sfcgal_point_y(pt);
165 if (sfcgal_geometry_is_3d(geom))
166 point.
z = sfcgal_point_z(pt);
175 case SFCGAL_TYPE_TRIANGLE:
179 for (i = 0; i < 4; i++)
181 const sfcgal_geometry_t *pt = sfcgal_triangle_vertex(geom, (i % 3));
182 point.
x = sfcgal_point_x(pt);
183 point.
y = sfcgal_point_y(pt);
185 if (sfcgal_geometry_is_3d(geom))
186 point.
z = sfcgal_point_z(pt);
197 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 lwerror(const char *fmt,...)
Write a notice out to the error handler.