PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ encode_mpoly()

static void encode_mpoly ( mvt_agg_context ctx,
LWMPOLY lwmpoly 
)
static

Definition at line 246 of file mvt.c.

References encode_ptarray(), mvt_agg_context::feature, LWMPOLY::geoms, MVT_RING, LWMPOLY::ngeoms, POINTARRAY::npoints, LWPOLY::nrings, and LWPOLY::rings.

Referenced by encode_geometry().

247 {
248  uint32_t i, j;
249  int32_t px = 0, py = 0;
250  size_t c = 0, offset = 0;
251  LWPOLY *poly;
252  VectorTile__Tile__Feature *feature = ctx->feature;
253  feature->type = VECTOR_TILE__TILE__GEOM_TYPE__POLYGON;
254  feature->has_type = 1;
255  for (i = 0; i < lwmpoly->ngeoms; i++)
256  for (j = 0; poly = lwmpoly->geoms[i], j < poly->nrings; j++)
257  c += 3 + ((poly->rings[j]->npoints - 1) * 2);
258  feature->geometry = palloc(sizeof(*feature->geometry) * c);
259  for (i = 0; i < lwmpoly->ngeoms; i++)
260  for (j = 0; poly = lwmpoly->geoms[i], j < poly->nrings; j++)
261  offset += encode_ptarray(ctx, MVT_RING,
262  poly->rings[j], feature->geometry + offset,
263  &px, &py);
264  feature->n_geometry = offset;
265 }
uint32_t ngeoms
Definition: liblwgeom.h:496
uint32_t nrings
Definition: liblwgeom.h:457
unsigned int uint32_t
Definition: uthash.h:78
Definition: mvt.c:53
LWPOLY ** geoms
Definition: liblwgeom.h:498
POINTARRAY ** rings
Definition: liblwgeom.h:459
VectorTile__Tile__Feature * feature
Definition: mvt.h:65
uint32_t npoints
Definition: liblwgeom.h:373
static uint32_t encode_ptarray(__attribute__((__unused__)) mvt_agg_context *ctx, enum mvt_type type, POINTARRAY *pa, uint32_t *buffer, int32_t *px, int32_t *py)
Definition: mvt.c:115
Here is the call graph for this function:
Here is the caller graph for this function: