312 int i, len, nrings, offset;
314 Data__Geometry *geometry;
316 int64_t *coords = NULL;
318 geometry =
galloc(DATA__GEOMETRY__TYPE__POLYGON);
325 lengths = palloc (
sizeof (uint32_t) * nrings);
328 for (i = 0; i < nrings; i++) {
329 pa = lwpoly->
rings[i];
337 geometry->n_lengths = nrings;
338 geometry->lengths = lengths;
341 geometry->n_coords = offset;
342 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)