PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ flatgeobuf_decode_row()

void flatgeobuf_decode_row ( struct flatgeobuf_decode_ctx ctx)

Definition at line 465 of file flatgeobuf.c.

466 {
467  HeapTuple heapTuple;
468  uint32_t natts = ctx->tupdesc->natts;
469 
470  Datum *values = palloc0(natts * sizeof(Datum *));
471  bool *isnull = palloc0(natts * sizeof(bool *));
472 
473  values[0] = Int32GetDatum(ctx->fid);
474 
475  if (flatgeobuf_decode_feature(ctx->ctx))
476  elog(ERROR, "flatgeobuf_decode_feature: unsuccessful");
477 
478  if (ctx->ctx->lwgeom != NULL) {
479  values[1] = PointerGetDatum(geometry_serialize(ctx->ctx->lwgeom));
480  } else {
481  POSTGIS_DEBUG(3, "geometry is null");
482  isnull[1] = true;
483  }
484 
485  if (natts > 2 && ctx->ctx->properties_len > 0)
486  decode_properties(ctx, values, isnull);
487 
488  heapTuple = heap_form_tuple(ctx->tupdesc, values, isnull);
489  ctx->result = HeapTupleGetDatum(heapTuple);
490  ctx->fid++;
491 
492  POSTGIS_DEBUGF(3, "fid now %d", ctx->fid);
493 
494  if (ctx->ctx->offset == ctx->ctx->size) {
495  POSTGIS_DEBUGF(3, "reached end at %ld", ctx->ctx->offset);
496  ctx->done = true;
497  }
498 }
static void decode_properties(struct flatgeobuf_decode_ctx *ctx, Datum *values, bool *isnull)
Definition: flatgeobuf.c:280
flatgeobuf_ctx * ctx
Definition: flatgeobuf.h:62

References flatgeobuf_decode_ctx::ctx, decode_properties(), flatgeobuf_decode_ctx::done, flatgeobuf_decode_ctx::fid, flatgeobuf_decode_ctx::result, and flatgeobuf_decode_ctx::tupdesc.

Referenced by pgis_fromflatgeobuf().

Here is the call graph for this function:
Here is the caller graph for this function: