PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ encode_mpoint()

static void encode_mpoint ( struct mvt_agg_context ctx,
LWMPOINT mpoint 
)
static

Definition at line 170 of file mvt.c.

References encode_ptarray_initial(), mvt_agg_context::feature, lwline_from_lwmpoint(), MVT_POINT, POINTARRAY::npoints, LWLINE::points, and LWMPOINT::srid.

Referenced by encode_geometry().

171 {
172  size_t c;
173  VectorTile__Tile__Feature *feature = ctx->feature;
174  // NOTE: inefficient shortcut LWMPOINT->LWLINE
175  LWLINE *lwline = lwline_from_lwmpoint(mpoint->srid, mpoint);
176  feature->type = VECTOR_TILE__TILE__GEOM_TYPE__POINT;
177  feature->has_type = 1;
178  c = 1 + lwline->points->npoints * 2;
179  feature->geometry = palloc(sizeof(*feature->geometry) * c);
180  feature->n_geometry = encode_ptarray_initial(ctx, MVT_POINT,
181  lwline->points, feature->geometry);
182 }
Definition: mvt.c:49
int npoints
Definition: liblwgeom.h:371
LWLINE * lwline_from_lwmpoint(int srid, const LWMPOINT *mpoint)
Definition: lwline.c:290
static uint32_t encode_ptarray_initial(struct mvt_agg_context *ctx, enum mvt_type type, POINTARRAY *pa, uint32_t *buffer)
Definition: mvt.c:152
VectorTile__Tile__Feature * feature
Definition: mvt.h:55
int32_t srid
Definition: liblwgeom.h:467
POINTARRAY * points
Definition: liblwgeom.h:422
Here is the call graph for this function:
Here is the caller graph for this function: