PostGIS  2.5.0dev-r@@SVN_REVISION@@
static VectorTile__Tile__Feature* tile_feature_copy ( const VectorTile__Tile__Feature *  feature,
int  key_offset,
int  value_offset 
)
static

Definition at line 961 of file mvt.c.

Referenced by vectortile_layer_combine().

962 {
963  uint32_t i;
964 
965  /* Null in => Null out */
966  if (!feature) return NULL;
967 
968  /* Init object */
969  VectorTile__Tile__Feature *nfeature = palloc(sizeof(VectorTile__Tile__Feature));
970  vector_tile__tile__feature__init(nfeature);
971 
972  /* Copy settings straight over */
973  nfeature->has_id = feature->has_id;
974  nfeature->id = feature->id;
975  nfeature->has_type = feature->has_type;
976  nfeature->type = feature->type;
977 
978  /* Copy tags over, offsetting indexes so they match the dictionaries */
979  /* at the Tile_Layer level */
980  if (feature->n_tags > 0)
981  {
982  nfeature->n_tags = feature->n_tags;
983  nfeature->tags = palloc(sizeof(uint32_t)*feature->n_tags);
984  for (i = 0; i < feature->n_tags/2; i++)
985  {
986  nfeature->tags[2*i] = feature->tags[2*i] + key_offset;
987  nfeature->tags[2*i+1] = feature->tags[2*i+1] + value_offset;
988  }
989  }
990 
991  /* Copy the raw geometry data over literally */
992  if (feature->n_geometry > 0)
993  {
994  nfeature->n_geometry = feature->n_geometry;
995  nfeature->geometry = palloc(sizeof(uint32_t)*feature->n_geometry);
996  memcpy(nfeature->geometry, feature->geometry, sizeof(uint32_t)*feature->n_geometry);
997  }
998 
999  /* Done */
1000  return nfeature;
1001 }
unsigned int uint32_t
Definition: uthash.h:78

Here is the caller graph for this function: