PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ vectortile_tile_combine()

static VectorTile__Tile* vectortile_tile_combine ( VectorTile__Tile *  tile1,
VectorTile__Tile *  tile2 
)
static

Definition at line 1419 of file mvt.c.

1420 {
1421  uint32_t i, j;
1422  VectorTile__Tile *tile;
1423 
1424  /* Hopelessly messing up memory ownership here */
1425  if (tile1->n_layers == 0 && tile2->n_layers == 0)
1426  return tile1;
1427  else if (tile1->n_layers == 0)
1428  return tile2;
1429  else if (tile2->n_layers == 0)
1430  return tile1;
1431 
1432  tile = palloc(sizeof(VectorTile__Tile));
1433  vector_tile__tile__init(tile);
1434  tile->layers = palloc(sizeof(void*));
1435  tile->n_layers = 0;
1436 
1437  /* Merge all matching layers in the files (basically always only one) */
1438  for (i = 0; i < tile1->n_layers; i++)
1439  {
1440  for (j = 0; j < tile2->n_layers; j++)
1441  {
1442  VectorTile__Tile__Layer *l1 = tile1->layers[i];
1443  VectorTile__Tile__Layer *l2 = tile2->layers[j];
1444  if (strcmp(l1->name, l2->name)==0)
1445  {
1446  VectorTile__Tile__Layer *layer = vectortile_layer_combine(l1, l2);
1447  if (!layer)
1448  continue;
1449  tile->layers[tile->n_layers++] = layer;
1450  /* Add a spare slot at the end of the array */
1451  tile->layers = repalloc(tile->layers, (tile->n_layers+1) * sizeof(void*));
1452  }
1453  }
1454  }
1455  return tile;
1456 }
static VectorTile__Tile__Layer * vectortile_layer_combine(const VectorTile__Tile__Layer *layer1, const VectorTile__Tile__Layer *layer2)
Definition: mvt.c:1370
unsigned int uint32_t
Definition: uthash.h:78

References vectortile_layer_combine().

Referenced by mvt_ctx_combine().

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