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)
486
487 heapTuple = heap_form_tuple(ctx->
tupdesc, values, isnull);
488 ctx->
result = HeapTupleGetDatum(heapTuple);
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);
496 }
497}
static void decode_properties(struct flatgeobuf_decode_ctx *ctx, Datum *values, bool *isnull)