PostGIS  2.5.0dev-r@@SVN_REVISION@@
static VectorTile__Tile* vectortile_tile_combine ( VectorTile__Tile *  tile1,
VectorTile__Tile *  tile2 
)
static

Definition at line 1054 of file mvt.c.

References vectortile_layer_combine().

Referenced by mvt_ctx_combine().

1055 {
1056  uint32_t i, j;
1057 
1058  /* Hopelessly messing up memory ownership here */
1059  if (tile1->n_layers == 0 && tile2->n_layers == 0)
1060  return tile1;
1061  else if (tile1->n_layers == 0)
1062  return tile2;
1063  else if (tile2->n_layers == 0)
1064  return tile1;
1065 
1066  VectorTile__Tile *tile = palloc(sizeof(VectorTile__Tile));
1067  vector_tile__tile__init(tile);
1068  tile->layers = palloc(sizeof(void*));
1069  tile->n_layers = 0;
1070 
1071  /* Merge all matching layers in the files (basically always only one) */
1072  for (i = 0; i < tile1->n_layers; i++)
1073  {
1074  for (j = 0; j < tile2->n_layers; j++)
1075  {
1076  VectorTile__Tile__Layer *l1 = tile1->layers[i];
1077  VectorTile__Tile__Layer *l2 = tile2->layers[j];
1078  if (strcmp(l1->name, l2->name)==0)
1079  {
1080  VectorTile__Tile__Layer *layer = vectortile_layer_combine(l1, l2);
1081  if (!layer)
1082  continue;
1083  tile->layers[tile->n_layers++] = layer;
1084  /* Add a spare slot at the end of the array */
1085  tile->layers = repalloc(tile->layers, (tile->n_layers+1) * sizeof(void*));
1086  }
1087  }
1088  }
1089  return tile;
1090 }
static VectorTile__Tile__Layer * vectortile_layer_combine(const VectorTile__Tile__Layer *layer1, const VectorTile__Tile__Layer *layer2)
Definition: mvt.c:1004
unsigned int uint32_t
Definition: uthash.h:78

Here is the call graph for this function:

Here is the caller graph for this function: