312{
313 int i, len, nrings, offset;
315 Data__Geometry *geometry;
316 uint32_t *lengths;
317 int64_t *coords = NULL;
318
319 geometry =
galloc(DATA__GEOMETRY__TYPE__POLYGON);
320
322
323 if (nrings == 0)
324 return geometry;
325
326 lengths = palloc (sizeof (uint32_t) * nrings);
327
328 offset = 0;
329 for (i = 0; i < nrings; i++) {
330 pa = lwpoly->
rings[i];
334 lengths[i] = len;
335 }
336
337 if (nrings > 1) {
338 geometry->n_lengths = nrings;
339 geometry->lengths = lengths;
340 }
341
342 geometry->n_coords = offset;
343 geometry->coords = coords;
344
345 return geometry;
346}
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)