PostGIS 3.0.6dev-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 435 of file lwgeom_out_geojson.c.

436{
437 ArrayType *v = DatumGetArrayTypeP(array);
438 Oid element_type = ARR_ELEMTYPE(v);
439 int *dim;
440 int ndim;
441 int nitems;
442 int count = 0;
443 Datum *elements;
444 bool *nulls;
445 int16 typlen;
446 bool typbyval;
447 char typalign;
448 JsonTypeCategory tcategory;
449 Oid outfuncoid;
450
451 ndim = ARR_NDIM(v);
452 dim = ARR_DIMS(v);
453 nitems = ArrayGetNItems(ndim, dim);
454
455 if (nitems <= 0)
456 {
457 appendStringInfoString(result, "[]");
458 return;
459 }
460
461 get_typlenbyvalalign(element_type,
462 &typlen, &typbyval, &typalign);
463
464 json_categorize_type(element_type,
465 &tcategory, &outfuncoid);
466
467 deconstruct_array(v, element_type, typlen, typbyval,
468 typalign, &elements, &nulls,
469 &nitems);
470
471 array_dim_to_json(result, 0, ndim, dim, elements, nulls, &count, tcategory,
472 outfuncoid, use_line_feeds);
473
474 pfree(elements);
475 pfree(nulls);
476}
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(), and json_categorize_type().

Referenced by datum_to_json().

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