PostGIS  3.1.6dev-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 569 of file lwgeom_out_geojson.c.

572 {
573  int i;
574  const char *sep;
575 
576  Assert(dim < ndims);
577 
578  sep = use_line_feeds ? ",\n " : ",";
579 
580  appendStringInfoChar(result, '[');
581 
582  for (i = 1; i <= dims[dim]; i++)
583  {
584  if (i > 1)
585  appendStringInfoString(result, sep);
586 
587  if (dim + 1 == ndims)
588  {
589  datum_to_json(vals[*valcount], nulls[*valcount], result, tcategory,
590  outfuncoid, false);
591  (*valcount)++;
592  }
593  else
594  {
595  /*
596  * Do we want line feeds on inner dimensions of arrays? For now
597  * we'll say no.
598  */
599  array_dim_to_json(result, dim + 1, ndims, dims, vals, nulls,
600  valcount, tcategory, outfuncoid, false);
601  }
602  }
603 
604  appendStringInfoChar(result, ']');
605 }
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: