PostGIS  2.5.0dev-r@@SVN_REVISION@@
static void parse_column_keys ( mvt_agg_context ctx)
static

Definition at line 304 of file mvt.c.

References add_key(), mvt_agg_context::geom_index, mvt_agg_context::geom_name, and get_tuple_desc().

Referenced by mvt_agg_transfn().

305 {
306  TupleDesc tupdesc = get_tuple_desc(ctx);
307  uint32_t natts = (uint32_t) tupdesc->natts;
308  uint32_t i;
309  bool geom_found = false;
310  char *key;
311  POSTGIS_DEBUG(2, "parse_column_keys called");
312 
313  for (i = 0; i < natts; i++) {
314 #if POSTGIS_PGSQL_VERSION < 110
315  Oid typoid = getBaseType(tupdesc->attrs[i]->atttypid);
316  char *tkey = tupdesc->attrs[i]->attname.data;
317 #else
318  Oid typoid = getBaseType(tupdesc->attrs[i].atttypid);
319  char *tkey = tupdesc->attrs[i].attname.data;
320 #endif
321 #if POSTGIS_PGSQL_VERSION >= 94
322  if (typoid == JSONBOID)
323  continue;
324 #endif
325  key = pstrdup(tkey);
326  if (ctx->geom_name == NULL) {
327  if (!geom_found && typoid == TypenameGetTypid("geometry")) {
328  ctx->geom_index = i;
329  geom_found = true;
330  continue;
331  }
332  } else {
333  if (!geom_found && strcmp(key, ctx->geom_name) == 0) {
334  ctx->geom_index = i;
335  geom_found = true;
336  continue;
337  }
338  }
339  add_key(ctx, key);
340  }
341  if (!geom_found)
342  elog(ERROR, "parse_column_keys: no geometry column found");
343  ReleaseTupleDesc(tupdesc);
344 }
char * geom_name
Definition: mvt.h:52
static uint32_t add_key(mvt_agg_context *ctx, char *name)
Definition: mvt.c:293
unsigned int uint32_t
Definition: uthash.h:78
static TupleDesc get_tuple_desc(mvt_agg_context *ctx)
Definition: mvt.c:275
uint32_t geom_index
Definition: mvt.h:53

Here is the call graph for this function:

Here is the caller graph for this function: