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