1329 VectorTile__Tile__Feature *nfeature;
1332 if (!feature)
return NULL;
1335 nfeature = palloc(
sizeof(VectorTile__Tile__Feature));
1336 vector_tile__tile__feature__init(nfeature);
1339 nfeature->has_id = feature->has_id;
1340 nfeature->id = feature->id;
1341 nfeature->has_type = feature->has_type;
1342 nfeature->type = feature->type;
1346 if (feature->n_tags > 0)
1348 nfeature->n_tags = feature->n_tags;
1349 nfeature->tags = palloc(
sizeof(
uint32_t)*feature->n_tags);
1350 for (i = 0; i < feature->n_tags/2; i++)
1352 nfeature->tags[2*i] = feature->tags[2*i] + key_offset;
1353 nfeature->tags[2*i+1] = feature->tags[2*i+1] + value_offset;
1358 if (feature->n_geometry > 0)
1360 nfeature->n_geometry = feature->n_geometry;
1361 nfeature->geometry = palloc(
sizeof(
uint32_t)*feature->n_geometry);
1362 memcpy(nfeature->geometry, feature->geometry,
sizeof(
uint32_t)*feature->n_geometry);