PostGIS  3.4.0dev-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 456 of file lwgeom_out_geojson.c.

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