PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ 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 649 of file lwgeom_out_geojson.c.

652 {
653  int i;
654  const char *sep;
655 
656  Assert(dim < ndims);
657 
658  sep = use_line_feeds ? ",\n " : ",";
659 
660  appendStringInfoChar(result, '[');
661 
662  for (i = 1; i <= dims[dim]; i++)
663  {
664  if (i > 1)
665  appendStringInfoString(result, sep);
666 
667  if (dim + 1 == ndims)
668  {
669  datum_to_json(vals[*valcount], nulls[*valcount], result, tcategory,
670  outfuncoid, false);
671  (*valcount)++;
672  }
673  else
674  {
675  /*
676  * Do we want line feeds on inner dimensions of arrays? For now
677  * we'll say no.
678  */
679  array_dim_to_json(result, dim + 1, ndims, dims, vals, nulls,
680  valcount, tcategory, outfuncoid, false);
681  }
682  }
683 
684  appendStringInfoChar(result, ']');
685 }
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 datum_to_json(), and result.

Referenced by array_to_json_internal().

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