PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ encode_poly()

static void encode_poly ( mvt_agg_context ctx,
LWPOLY lwpoly 
)
static

Definition at line 198 of file mvt.c.

199 {
200  uint32_t i;
201  int32_t px = 0, py = 0;
202  size_t c = 0, offset = 0;
203  VectorTile__Tile__Feature *feature = ctx->feature;
204  feature->type = VECTOR_TILE__TILE__GEOM_TYPE__POLYGON;
205  for (i = 0; i < lwpoly->nrings; i++)
206  c += 3 + ((lwpoly->rings[i]->npoints - 1) * 2);
207  feature->geometry = palloc(sizeof(*feature->geometry) * c);
208  for (i = 0; i < lwpoly->nrings; i++)
209  offset += encode_ptarray(ctx, MVT_RING,
210  lwpoly->rings[i],
211  feature->geometry + offset, &px, &py);
212  feature->n_geometry = offset;
213 }
@ MVT_RING
Definition: mvt.c:63
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:89
POINTARRAY ** rings
Definition: liblwgeom.h:533
uint32_t nrings
Definition: liblwgeom.h:538
uint32_t npoints
Definition: liblwgeom.h:441
VectorTile__Tile__Feature * feature
Definition: mvt.h:75

References encode_ptarray(), mvt_agg_context::feature, MVT_RING, 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: