139 switch (sfcgal_geometry_type_id(geom))
141 case SFCGAL_TYPE_POINT:
144 point.
x = sfcgal_point_x(geom);
145 point.
y = sfcgal_point_y(geom);
147 if (sfcgal_geometry_is_3d(geom))
148 point.
z = sfcgal_point_z(geom);
156 case SFCGAL_TYPE_LINESTRING:
158 npoints = sfcgal_linestring_num_points(geom);
161 for (i = 0; i < npoints; i++)
163 const sfcgal_geometry_t *pt = sfcgal_linestring_point_n(geom, i);
164 point.
x = sfcgal_point_x(pt);
165 point.
y = sfcgal_point_y(pt);
167 if (sfcgal_geometry_is_3d(geom))
168 point.
z = sfcgal_point_z(pt);
177 case SFCGAL_TYPE_TRIANGLE:
181 for (i = 0; i < 4; i++)
183 const sfcgal_geometry_t *pt = sfcgal_triangle_vertex(geom, (i % 3));
184 point.
x = sfcgal_point_x(pt);
185 point.
y = sfcgal_point_y(pt);
187 if (sfcgal_geometry_is_3d(geom))
188 point.
z = sfcgal_point_z(pt);
199 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.