PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ encode_triangle()

static Data__Geometry* encode_triangle ( struct geobuf_agg_context ctx,
LWTRIANGLE lwtri 
)
static

Definition at line 257 of file geobuf.c.

258 {
259  Data__Geometry *geometry = galloc(DATA__GEOMETRY__TYPE__POLYGON);
260  POINTARRAY *pa = lwtri->points;
261  uint32_t len;
262 
263  if (pa->npoints == 0)
264  return geometry;
265 
266  len = pa->npoints - 1;
267  geometry->n_coords = len * ctx->dimensions;
268  geometry->coords = encode_coords(ctx, pa, NULL, len, 0);
269 
270  return geometry;
271 }
static Data__Geometry * galloc(Data__Geometry__Type type)
Definition: geobuf.c:37
static int64_t * encode_coords(struct geobuf_agg_context *ctx, POINTARRAY *pa, int64_t *coords, int len, int offset)
Definition: geobuf.c:162
POINTARRAY * points
Definition: liblwgeom.h:481
uint32_t npoints
Definition: liblwgeom.h:413
uint32_t dimensions
Definition: geobuf.h:61

References geobuf_agg_context::dimensions, encode_coords(), galloc(), POINTARRAY::npoints, and LWTRIANGLE::points.

Referenced by encode_geometry().

Here is the call graph for this function:
Here is the caller graph for this function: