PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ encode_triangle()

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

Definition at line 256 of file geobuf.c.

257 {
258  Data__Geometry *geometry = galloc(DATA__GEOMETRY__TYPE__POLYGON);
259  POINTARRAY *pa = lwtri->points;
260  uint32_t len;
261 
262  if (pa->npoints == 0)
263  return geometry;
264 
265  len = pa->npoints - 1;
266  geometry->n_coords = (size_t)len * ctx->dimensions;
267  geometry->coords = encode_coords(ctx, pa, NULL, len, 0);
268 
269  return geometry;
270 }
static Data__Geometry * galloc(Data__Geometry__Type type)
Definition: geobuf.c:36
static int64_t * encode_coords(struct geobuf_agg_context *ctx, POINTARRAY *pa, int64_t *coords, int len, int offset)
Definition: geobuf.c:161
POINTARRAY * points
Definition: liblwgeom.h:495
uint32_t npoints
Definition: liblwgeom.h:427
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: