PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ encode_mline()

static void encode_mline ( struct mvt_agg_context ctx,
LWMLINE lwmline 
)
static

Definition at line 196 of file mvt.c.

References encode_ptarray(), mvt_agg_context::feature, LWMLINE::geoms, MVT_LINE, LWMLINE::ngeoms, POINTARRAY::npoints, and LWLINE::points.

Referenced by encode_geometry().

197 {
198  uint32_t i;
199  int32_t px = 0, py = 0;
200  size_t c = 0, offset = 0;
201  VectorTile__Tile__Feature *feature = ctx->feature;
202  feature->type = VECTOR_TILE__TILE__GEOM_TYPE__LINESTRING;
203  feature->has_type = 1;
204  for (i = 0; i < lwmline->ngeoms; i++)
205  c += 2 + lwmline->geoms[i]->points->npoints * 2;
206  feature->geometry = palloc(sizeof(*feature->geometry) * c);
207  for (i = 0; i < lwmline->ngeoms; i++)
208  offset += encode_ptarray(ctx, MVT_LINE,
209  lwmline->geoms[i]->points,
210  feature->geometry + offset, &px, &py);
211  feature->n_geometry = offset;
212 }
int npoints
Definition: liblwgeom.h:371
int ngeoms
Definition: liblwgeom.h:481
unsigned int uint32_t
Definition: uthash.h:78
Definition: mvt.c:50
LWLINE ** geoms
Definition: liblwgeom.h:483
static uint32_t encode_ptarray(struct mvt_agg_context *ctx, enum mvt_type type, POINTARRAY *pa, uint32_t *buffer, int32_t *px, int32_t *py)
Definition: mvt.c:106
VectorTile__Tile__Feature * feature
Definition: mvt.h:55
POINTARRAY * points
Definition: liblwgeom.h:422
Here is the call graph for this function:
Here is the caller graph for this function: