311{
312 int i, len, nrings, offset;
314 Data__Geometry *geometry;
315 uint32_t *lengths;
316 int64_t *coords = NULL;
317
318 geometry =
galloc(DATA__GEOMETRY__TYPE__POLYGON);
319
321
322 if (nrings == 0)
323 return geometry;
324
325 lengths = palloc (sizeof (uint32_t) * nrings);
326
327 offset = 0;
328 for (i = 0; i < nrings; i++) {
329 pa = lwpoly->
rings[i];
333 lengths[i] = len;
334 }
335
336 if (nrings > 1) {
337 geometry->n_lengths = nrings;
338 geometry->lengths = lengths;
339 }
340
341 geometry->n_coords = offset;
342 geometry->coords = coords;
343
344 return geometry;
345}
static int64_t * encode_coords(struct geobuf_agg_context *ctx, POINTARRAY *pa, int64_t *coords, int len, int offset)
static Data__Geometry * galloc(Data__Geometry__Type type)