PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ encode_poly()

static void encode_poly ( struct mvt_agg_context ctx,
LWPOLY lwpoly 
)
static

Definition at line 214 of file mvt.c.

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

Referenced by encode_geometry().

215 {
216  uint32_t i;
217  int32_t px = 0, py = 0;
218  size_t c = 0, offset = 0;
219  VectorTile__Tile__Feature *feature = ctx->feature;
220  feature->type = VECTOR_TILE__TILE__GEOM_TYPE__POLYGON;
221  feature->has_type = 1;
222  for (i = 0; i < lwpoly->nrings; i++)
223  c += 3 + ((lwpoly->rings[i]->npoints - 1) * 2);
224  feature->geometry = palloc(sizeof(*feature->geometry) * c);
225  for (i = 0; i < lwpoly->nrings; i++)
226  offset += encode_ptarray(ctx, MVT_RING,
227  lwpoly->rings[i],
228  feature->geometry + offset, &px, &py);
229  feature->n_geometry = offset;
230 }
int npoints
Definition: liblwgeom.h:371
unsigned int uint32_t
Definition: uthash.h:78
Definition: mvt.c:51
POINTARRAY ** rings
Definition: liblwgeom.h:457
int nrings
Definition: liblwgeom.h:455
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
Here is the call graph for this function:
Here is the caller graph for this function: