302 int i, len, nrings, offset;
304 Data__Geometry *geometry;
306 int64_t *coords = NULL;
308 geometry =
galloc(DATA__GEOMETRY__TYPE__POLYGON);
315 lengths = palloc (
sizeof (
uint32_t) * nrings);
318 for (i = 0; i < nrings; i++) {
319 pa = lwpoly->
rings[i];
327 geometry->n_lengths = nrings;
328 geometry->lengths = lengths;
331 geometry->n_coords = offset;
332 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)