PostGIS  3.7.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 531 of file lwgeom_out_geojson.c.

532 {
533  ArrayType *v = DatumGetArrayTypeP(array);
534  Oid element_type = ARR_ELEMTYPE(v);
535  int *dim;
536  int ndim;
537  int nitems;
538  int count = 0;
539  Datum *elements;
540  bool *nulls;
541  int16 typlen;
542  bool typbyval;
543  char typalign;
544  JsonTypeCategory tcategory;
545  Oid outfuncoid;
546 
547  ndim = ARR_NDIM(v);
548  dim = ARR_DIMS(v);
549  nitems = ArrayGetNItems(ndim, dim);
550 
551  if (nitems <= 0)
552  {
553  appendStringInfoString(result, "[]");
554  return;
555  }
556 
557  get_typlenbyvalalign(element_type,
558  &typlen, &typbyval, &typalign);
559 
560  json_categorize_type(element_type,
561  &tcategory, &outfuncoid);
562 
563  deconstruct_array(v, element_type, typlen, typbyval,
564  typalign, &elements, &nulls,
565  &nitems);
566 
567  array_dim_to_json(result, 0, ndim, dim, elements, nulls, &count, tcategory,
568  outfuncoid, use_line_feeds);
569 
570  pfree(elements);
571  pfree(nulls);
572 }
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: