Convert an ND_STATS to a JSON representation for external use.
Definition at line 474 of file gserialized_estimate.c.
476 char *json_extent, *str;
479 int ndims = (int)roundf(nd_stats->
ndims);
486 for ( d = 0; d < ndims; d++ )
static char * nd_box_to_json(const ND_BOX *nd_box, int ndims)
Convert an ND_BOX to a JSON string for printing.
int stringbuffer_aprintf(stringbuffer_t *s, const char *fmt,...)
Appends a formatted string to the current string buffer, using the format and argument list provided.
stringbuffer_t * stringbuffer_create(void)
Allocate a new stringbuffer_t.
void stringbuffer_append(stringbuffer_t *s, const char *a)
Append the specified string to the stringbuffer_t.
void stringbuffer_destroy(stringbuffer_t *s)
Free the stringbuffer_t and all memory managed within it.
char * stringbuffer_getstringcopy(stringbuffer_t *s)
Returns a newly allocated string large enough to contain the current state of the string.
float4 histogram_features
References ND_STATS_T::cells_covered, ND_STATS_T::extent, ND_STATS_T::histogram_cells, ND_STATS_T::histogram_features, nd_box_to_json(), ND_STATS_T::ndims, ND_STATS_T::not_null_features, ND_STATS_T::sample_features, ND_STATS_T::size, stringbuffer_append(), stringbuffer_aprintf(), stringbuffer_create(), stringbuffer_destroy(), stringbuffer_getstringcopy(), and ND_STATS_T::table_features.
Referenced by _postgis_gserialized_stats(), compute_gserialized_stats_mode(), estimate_join_selectivity(), and gserialized_gist_sel().