PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ array_dim_to_json()

static void array_dim_to_json ( StringInfo  result,
int  dim,
int  ndims,
int *  dims,
Datum *  vals,
bool *  nulls,
int *  valcount,
JsonTypeCategory  tcategory,
Oid  outfuncoid,
bool  use_line_feeds 
)
static

Definition at line 645 of file lwgeom_out_geojson.c.

648{
649 int i;
650 const char *sep;
651
652 Assert(dim < ndims);
653
654 sep = use_line_feeds ? ",\n " : ",";
655
656 appendStringInfoChar(result, '[');
657
658 for (i = 1; i <= dims[dim]; i++)
659 {
660 if (i > 1)
661 appendStringInfoString(result, sep);
662
663 if (dim + 1 == ndims)
664 {
665 datum_to_json(vals[*valcount], nulls[*valcount], result, tcategory,
666 outfuncoid, false);
667 (*valcount)++;
668 }
669 else
670 {
671 /*
672 * Do we want line feeds on inner dimensions of arrays? For now
673 * we'll say no.
674 */
675 array_dim_to_json(result, dim + 1, ndims, dims, vals, nulls,
676 valcount, tcategory, outfuncoid, false);
677 }
678 }
679
680 appendStringInfoChar(result, ']');
681}
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition cu_print.c:267
static void array_dim_to_json(StringInfo result, int dim, int ndims, int *dims, Datum *vals, bool *nulls, int *valcount, JsonTypeCategory tcategory, Oid outfuncoid, bool use_line_feeds)
static void datum_to_json(Datum val, bool is_null, StringInfo result, JsonTypeCategory tcategory, Oid outfuncoid, bool key_scalar)

References array_dim_to_json(), datum_to_json(), and result.

Referenced by array_dim_to_json(), and array_to_json_internal().

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