PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ encode_mpoly()

static void encode_mpoly ( struct feature_builder feature,
LWMPOLY lwmpoly 
)
static

Definition at line 267 of file mvt.c.

268 {
269  uint32_t i, j;
270  int32_t px = 0, py = 0;
271  size_t c = 0, offset = 0;
272  LWPOLY *poly;
273  feature->type = VECTOR_TILE__TILE__GEOM_TYPE__POLYGON;
274  for (i = 0; i < lwmpoly->ngeoms; i++)
275  for (j = 0; poly = lwmpoly->geoms[i], j < poly->nrings; j++)
276  c += 3 + ((poly->rings[j]->npoints - 1) * 2);
277  feature->geometry = palloc(sizeof(*feature->geometry) * c);
278  for (i = 0; i < lwmpoly->ngeoms; i++)
279  for (j = 0; poly = lwmpoly->geoms[i], j < poly->nrings; j++)
280  offset += encode_ptarray(MVT_RING,
281  poly->rings[j], feature->geometry + offset,
282  &px, &py);
283  feature->n_geometry = offset;
284 }
@ MVT_RING
Definition: mvt.c:60
static uint32_t encode_ptarray(enum mvt_type type, POINTARRAY *pa, uint32_t *buffer, int32_t *px, int32_t *py)
Definition: mvt.c:150
uint32_t ngeoms
Definition: liblwgeom.h:566
LWPOLY ** geoms
Definition: liblwgeom.h:561
POINTARRAY ** rings
Definition: liblwgeom.h:519
uint32_t nrings
Definition: liblwgeom.h:524
uint32_t npoints
Definition: liblwgeom.h:427
VectorTile__Tile__GeomType type
Definition: mvt.c:93
size_t n_geometry
Definition: mvt.c:94
uint32_t * geometry
Definition: mvt.c:95

References encode_ptarray(), feature_builder::geometry, LWMPOLY::geoms, MVT_RING, feature_builder::n_geometry, LWMPOLY::ngeoms, POINTARRAY::npoints, LWPOLY::nrings, LWPOLY::rings, and feature_builder::type.

Referenced by encode_feature_geometry().

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