PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ encode_mpoly()

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

Definition at line 266 of file mvt.c.

267 {
268  uint32_t i, j;
269  int32_t px = 0, py = 0;
270  size_t c = 0, offset = 0;
271  LWPOLY *poly;
272  feature->type = VECTOR_TILE__TILE__GEOM_TYPE__POLYGON;
273  for (i = 0; i < lwmpoly->ngeoms; i++)
274  for (j = 0; poly = lwmpoly->geoms[i], j < poly->nrings; j++)
275  c += 3 + ((poly->rings[j]->npoints - 1) * 2);
276  feature->geometry = palloc(sizeof(*feature->geometry) * c);
277  for (i = 0; i < lwmpoly->ngeoms; i++)
278  for (j = 0; poly = lwmpoly->geoms[i], j < poly->nrings; j++)
279  offset += encode_ptarray(MVT_RING,
280  poly->rings[j], feature->geometry + offset,
281  &px, &py);
282  feature->n_geometry = offset;
283 }
@ MVT_RING
Definition: mvt.c:59
static uint32_t encode_ptarray(enum mvt_type type, POINTARRAY *pa, uint32_t *buffer, int32_t *px, int32_t *py)
Definition: mvt.c:149
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:92
size_t n_geometry
Definition: mvt.c:93
uint32_t * geometry
Definition: mvt.c:94

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: