PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ encode_mpoint()

static void encode_mpoint ( mvt_agg_context ctx,
LWMPOINT mpoint 
)
static

Definition at line 184 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().

185 {
186  size_t c;
187  VectorTile__Tile__Feature *feature = ctx->feature;
188  // NOTE: inefficient shortcut LWMPOINT->LWLINE
189  LWLINE *lwline = lwline_from_lwmpoint(mpoint->srid, mpoint);
190  feature->type = VECTOR_TILE__TILE__GEOM_TYPE__POINT;
191  feature->has_type = 1;
192  c = 1 + lwline->points->npoints * 2;
193  feature->geometry = palloc(sizeof(*feature->geometry) * c);
194  feature->n_geometry = encode_ptarray_initial(ctx, MVT_POINT,
195  lwline->points, feature->geometry);
196 }
Definition: mvt.c:51
static uint32_t encode_ptarray_initial(mvt_agg_context *ctx, enum mvt_type type, POINTARRAY *pa, uint32_t *buffer)
Definition: mvt.c:166
LWLINE * lwline_from_lwmpoint(int srid, const LWMPOINT *mpoint)
Definition: lwline.c:284
VectorTile__Tile__Feature * feature
Definition: mvt.h:65
int32_t srid
Definition: liblwgeom.h:469
POINTARRAY * points
Definition: liblwgeom.h:424
uint32_t npoints
Definition: liblwgeom.h:373
Here is the call graph for this function:
Here is the caller graph for this function: