PostGIS  3.2.2dev-r@@SVN_REVISION@@

◆ flatgeobuf_decode_row()

void flatgeobuf_decode_row ( struct flatgeobuf_decode_ctx ctx)

Definition at line 457 of file flatgeobuf.c.

458 {
459  HeapTuple heapTuple;
460  uint32_t natts = ctx->tupdesc->natts;
461 
462  Datum *values = palloc0(natts * sizeof(Datum *));
463  bool *isnull = palloc0(natts * sizeof(bool *));
464 
465  values[0] = Int32GetDatum(ctx->fid);
466 
467  if (flatgeobuf_decode_feature(ctx->ctx))
468  elog(ERROR, "flatgeobuf_decode_feature: unsuccessful");
469 
470  if (ctx->ctx->lwgeom != NULL) {
471  values[1] = PointerGetDatum(geometry_serialize(ctx->ctx->lwgeom));
472  } else {
473  POSTGIS_DEBUG(3, "geometry is null");
474  isnull[1] = true;
475  }
476 
477  if (natts > 2 && ctx->ctx->properties_len > 0)
478  decode_properties(ctx, values, isnull);
479 
480  heapTuple = heap_form_tuple(ctx->tupdesc, values, isnull);
481  ctx->result = HeapTupleGetDatum(heapTuple);
482  ctx->fid++;
483 
484  POSTGIS_DEBUGF(3, "fid now %d", ctx->fid);
485 
486  if (ctx->ctx->offset == ctx->ctx->size) {
487  POSTGIS_DEBUGF(3, "reached end at %ld", ctx->ctx->offset);
488  ctx->done = true;
489  }
490 }
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: