PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ encode_mpoly()

static void encode_mpoly ( mvt_agg_context ctx,
LWMPOLY lwmpoly 
)
static

Definition at line 247 of file mvt.c.

248 {
249  uint32_t i, j;
250  int32_t px = 0, py = 0;
251  size_t c = 0, offset = 0;
252  LWPOLY *poly;
253  VectorTile__Tile__Feature *feature = ctx->feature;
254  feature->type = VECTOR_TILE__TILE__GEOM_TYPE__POLYGON;
255  feature->has_type = 1;
256  for (i = 0; i < lwmpoly->ngeoms; i++)
257  for (j = 0; poly = lwmpoly->geoms[i], j < poly->nrings; j++)
258  c += 3 + ((poly->rings[j]->npoints - 1) * 2);
259  feature->geometry = palloc(sizeof(*feature->geometry) * c);
260  for (i = 0; i < lwmpoly->ngeoms; i++)
261  for (j = 0; poly = lwmpoly->geoms[i], j < poly->nrings; j++)
262  offset += encode_ptarray(ctx, MVT_RING,
263  poly->rings[j], feature->geometry + offset,
264  &px, &py);
265  feature->n_geometry = offset;
266 }
@ MVT_RING
Definition: mvt.c:54
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:116
uint32_t ngeoms
Definition: liblwgeom.h:497
LWPOLY ** geoms
Definition: liblwgeom.h:499
POINTARRAY ** rings
Definition: liblwgeom.h:460
uint32_t nrings
Definition: liblwgeom.h:458
uint32_t npoints
Definition: liblwgeom.h:374
VectorTile__Tile__Feature * feature
Definition: mvt.h:65
unsigned int uint32_t
Definition: uthash.h:78

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

Referenced by encode_geometry().

Here is the call graph for this function:
Here is the caller graph for this function: