1463 int key2_offset, value2_offset;
1464 VectorTile__Tile__Layer *layer = palloc(
sizeof(VectorTile__Tile__Layer));
1465 vector_tile__tile__layer__init(layer);
1468 layer->version = layer1->version;
1469 layer->name = pstrdup(layer1->name);
1470 layer->has_extent = layer1->has_extent;
1471 layer->extent = layer1->extent;
1475 layer->n_keys = layer1->n_keys + layer2->n_keys;
1476 layer->keys = layer->n_keys ? palloc(layer->n_keys *
sizeof(
void*)) : NULL;
1477 for (i = 0; i < layer1->n_keys; i++)
1478 layer->keys[j++] = pstrdup(layer1->keys[i]);
1480 for (i = 0; i < layer2->n_keys; i++)
1481 layer->keys[j++] = pstrdup(layer2->keys[i]);
1486 layer->n_values = layer1->n_values + layer2->n_values;
1487 layer->values = layer->n_values ? palloc(layer->n_values *
sizeof(
void*)) : NULL;
1489 for (i = 0; i < layer1->n_values; i++)
1492 for (i = 0; i < layer2->n_values; i++)
1496 layer->n_features = layer1->n_features + layer2->n_features;
1497 layer->features = layer->n_features ? palloc(layer->n_features *
sizeof(
void*)) : NULL;
1499 for (i = 0; i < layer1->n_features; i++)
1501 for (i = 0; i < layer2->n_features; i++)
1502 layer->features[j++] =
tile_feature_copy(layer2->features[i], key2_offset, value2_offset);
static VectorTile__Tile__Feature * tile_feature_copy(const VectorTile__Tile__Feature *feature, int key_offset, int value_offset)
static VectorTile__Tile__Value * tile_value_copy(const VectorTile__Tile__Value *value)