313 int i, len, nrings, offset;
315 Data__Geometry *geometry;
317 int64_t *coords = NULL;
319 geometry =
galloc(DATA__GEOMETRY__TYPE__POLYGON);
326 lengths = palloc (
sizeof (uint32_t) * nrings);
329 for (i = 0; i < nrings; i++) {
330 pa = lwpoly->
rings[i];
338 geometry->n_lengths = nrings;
339 geometry->lengths = lengths;
342 geometry->n_coords = offset;
343 geometry->coords = coords;
static Data__Geometry * galloc(Data__Geometry__Type type)
static int64_t * encode_coords(struct geobuf_agg_context *ctx, POINTARRAY *pa, int64_t *coords, int len, int offset)