1419 VectorTile__Tile__Feature *nfeature;
1422 if (!feature)
return NULL;
1425 nfeature = palloc(
sizeof(VectorTile__Tile__Feature));
1426 vector_tile__tile__feature__init(nfeature);
1429 nfeature->has_id = feature->has_id;
1430 nfeature->id = feature->id;
1431 nfeature->has_type = feature->has_type;
1432 nfeature->type = feature->type;
1436 if (feature->n_tags > 0)
1438 nfeature->n_tags = feature->n_tags;
1439 nfeature->tags = palloc(
sizeof(uint32_t)*feature->n_tags);
1440 for (i = 0; i < feature->n_tags/2; i++)
1442 nfeature->tags[2*i] = feature->tags[2*i] + key_offset;
1443 nfeature->tags[2*i+1] = feature->tags[2*i+1] + value_offset;
1448 if (feature->n_geometry > 0)
1450 nfeature->n_geometry = feature->n_geometry;
1451 nfeature->geometry = palloc(
sizeof(uint32_t)*feature->n_geometry);
1452 memcpy(nfeature->geometry, feature->geometry,
sizeof(uint32_t)*feature->n_geometry);