PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ encode_line()

static Data__Geometry* encode_line ( struct geobuf_agg_context ctx,
LWLINE lwline 
)
static

Definition at line 243 of file geobuf.c.

References geobuf_agg_context::dimensions, encode_coords(), galloc(), POINTARRAY::npoints, and LWLINE::points.

Referenced by encode_geometry().

245 {
246  POINTARRAY *pa;
247  Data__Geometry *geometry;
248 
249  geometry = galloc(DATA__GEOMETRY__TYPE__LINESTRING);
250 
251  pa = lwline->points;
252 
253  if (pa->npoints == 0)
254  return geometry;
255 
256  geometry->n_coords = pa->npoints * ctx->dimensions;
257  geometry->coords = encode_coords(ctx, pa, NULL, pa->npoints, 0);
258 
259  return geometry;
260 }
int npoints
Definition: liblwgeom.h:371
static Data__Geometry * galloc(Data__Geometry__Type type)
Definition: geobuf.c:36
uint32_t dimensions
Definition: geobuf.h:61
static int64_t * encode_coords(struct geobuf_agg_context *ctx, POINTARRAY *pa, int64_t *coords, int len, int offset)
Definition: geobuf.c:168
POINTARRAY * points
Definition: liblwgeom.h:422
Here is the call graph for this function:
Here is the caller graph for this function: