PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ array_to_json_internal()

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

Definition at line 527 of file lwgeom_out_geojson.c.

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