PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ flatgeobuf_decode_row()

void flatgeobuf_decode_row ( struct flatgeobuf_decode_ctx ctx)

Definition at line 464 of file flatgeobuf.c.

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