1373 int key2_offset, value2_offset;
1374 VectorTile__Tile__Layer *layer = palloc(
sizeof(VectorTile__Tile__Layer));
1375 vector_tile__tile__layer__init(layer);
1378 layer->version = layer1->version;
1379 layer->name = pstrdup(layer1->name);
1380 layer->has_extent = layer1->has_extent;
1381 layer->extent = layer1->extent;
1385 layer->n_keys = layer1->n_keys + layer2->n_keys;
1386 layer->keys = layer->n_keys ? palloc(layer->n_keys *
sizeof(
void*)) : NULL;
1387 for (i = 0; i < layer1->n_keys; i++)
1388 layer->keys[j++] = pstrdup(layer1->keys[i]);
1390 for (i = 0; i < layer2->n_keys; i++)
1391 layer->keys[j++] = pstrdup(layer2->keys[i]);
1396 layer->n_values = layer1->n_values + layer2->n_values;
1397 layer->values = layer->n_values ? palloc(layer->n_values *
sizeof(
void*)) : NULL;
1399 for (i = 0; i < layer1->n_values; i++)
1402 for (i = 0; i < layer2->n_values; i++)
1406 layer->n_features = layer1->n_features + layer2->n_features;
1407 layer->features = layer->n_features ? palloc(layer->n_features *
sizeof(
void*)) : NULL;
1409 for (i = 0; i < layer1->n_features; i++)
1411 for (i = 0; i < layer2->n_features; i++)
1412 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)