275{
276 int i, offset, ngeoms;
278 Data__Geometry *geometry;
279 uint32_t *lengths;
280 int64_t *coords = NULL;
281
282 geometry =
galloc(DATA__GEOMETRY__TYPE__MULTILINESTRING);
283
285
286 if (ngeoms == 0)
287 return geometry;
288
289 lengths = palloc (sizeof (uint32_t) * ngeoms);
290
291 offset = 0;
292 for (i = 0; i < ngeoms; i++) {
297 }
298
299 if (ngeoms > 1) {
300 geometry->n_lengths = ngeoms;
301 geometry->lengths = lengths;
302 }
303
304 geometry->n_coords = offset;
305 geometry->coords = coords;
306
307 return geometry;
308}
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)