PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ array_to_json_internal()

static void array_to_json_internal ( Datum  array,
StringInfo  result,
bool  use_line_feeds 
)
static

Definition at line 451 of file lwgeom_out_geojson.c.

452 {
453  ArrayType *v = DatumGetArrayTypeP(array);
454  Oid element_type = ARR_ELEMTYPE(v);
455  int *dim;
456  int ndim;
457  int nitems;
458  int count = 0;
459  Datum *elements;
460  bool *nulls;
461  int16 typlen;
462  bool typbyval;
463  char typalign;
464  JsonTypeCategory tcategory;
465  Oid outfuncoid;
466 
467  ndim = ARR_NDIM(v);
468  dim = ARR_DIMS(v);
469  nitems = ArrayGetNItems(ndim, dim);
470 
471  if (nitems <= 0)
472  {
473  appendStringInfoString(result, "[]");
474  return;
475  }
476 
477  get_typlenbyvalalign(element_type,
478  &typlen, &typbyval, &typalign);
479 
480  json_categorize_type(element_type,
481  &tcategory, &outfuncoid);
482 
483  deconstruct_array(v, element_type, typlen, typbyval,
484  typalign, &elements, &nulls,
485  &nitems);
486 
487  array_dim_to_json(result, 0, ndim, dim, elements, nulls, &count, tcategory,
488  outfuncoid, use_line_feeds);
489 
490  pfree(elements);
491  pfree(nulls);
492 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:267
static void json_categorize_type(Oid typoid, JsonTypeCategory *tcategory, Oid *outfuncoid)
JsonTypeCategory
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)
int count
Definition: genraster.py:57

References array_dim_to_json(), genraster::count, json_categorize_type(), and result.

Referenced by datum_to_json().

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