PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ encode_point()

static Data__Geometry* encode_point ( struct geobuf_agg_context ctx,
LWPOINT lwpoint 
)
static

Definition at line 194 of file geobuf.c.

References geobuf_agg_context::dimensions, encode_coords(), galloc(), POINTARRAY::npoints, and LWPOINT::point.

Referenced by encode_geometry().

196 {
197  int npoints;
198  Data__Geometry *geometry;
199  POINTARRAY *pa;
200 
201  geometry = galloc(DATA__GEOMETRY__TYPE__POINT);
202 
203  pa = lwpoint->point;
204  npoints = pa->npoints;
205 
206  if (npoints == 0)
207  return geometry;
208 
209  geometry->n_coords = npoints * ctx->dimensions;
210  geometry->coords = encode_coords(ctx, pa, NULL, 1, 0);
211 
212  return geometry;
213 }
int npoints
Definition: liblwgeom.h:371
static Data__Geometry * galloc(Data__Geometry__Type type)
Definition: geobuf.c:36
POINTARRAY * point
Definition: liblwgeom.h:411
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
Here is the call graph for this function:
Here is the caller graph for this function: