Skip to content

Commit

Permalink
Improve MFJSON output (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanzimanyi authored May 28, 2024
1 parent cf0d371 commit 453de85
Show file tree
Hide file tree
Showing 5 changed files with 327 additions and 591 deletions.
4 changes: 2 additions & 2 deletions doc/temporal_types_aggregation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

<para>The temporal aggregate functions are the following ones:</para>
<itemizedlist>
<listitem><para>For all temporal types, the function <varname>tXount</varname> generalize the traditional function <varname>count</varname>. The temporal count can be used to compute at each point in time the number of available objects (for example, number of cars in an area).</para></listitem>
<listitem><para>For all temporal types, the function <varname>tCount</varname> generalize the traditional function <varname>count</varname>. The temporal count can be used to compute at each point in time the number of available objects (for example, number of cars in an area).</para></listitem>
<listitem><para>For all temporal types, function <varname>extent</varname> returns a bounding box that encloses a set of temporal values. Depending on the base type, the result of this function can be a <varname>tstzspan</varname>, a <varname>tbox</varname> or an <varname>stbox</varname>.</para></listitem>
<listitem><para>For the temporal Boolean type, the functions <varname>tAnd</varname> and <varname>tor</varname> generalize the traditional functions <varname>and</varname> and <varname>or</varname>.</para></listitem>
<listitem><para>For the temporal Boolean type, the functions <varname>tAnd</varname> and <varname>tOr</varname> generalize the traditional functions <varname>and</varname> and <varname>or</varname>.</para></listitem>
<listitem><para>For temporal numeric types, there are two types of temporal aggregate functions. The functions <varname>tMin</varname>, <varname>tMax</varname>, <varname>tSum</varname>, and <varname>tAvg</varname> generalize the traditional functions <varname>min</varname>, <varname>max</varname>, <varname>sum</varname>, and <varname>avg</varname>. Furthermore, the functions <varname>wMin</varname>, <varname>wMax</varname>, <varname>wCount</varname>, <varname>wSum</varname>, and <varname>wAvg</varname> are window (or cumulative) versions of the traditional functions that, given a time interval w, compute the value of the function at an instant t by considering the values during the interval [t-w, t]. All window aggregate functions are available for temporal integers, while for temporal floats only window minimum and maximum are meaningful.</para></listitem>
<listitem><para>For the temporal text type, the functions <varname>tMin</varname> y <varname>tMax</varname> generalize the traditional functions <varname>min</varname> and <varname>max</varname>.</para></listitem>
<listitem><para>Finally, for temporal point types, the function <varname>tCentroid</varname> generalizes the function <varname>ST_Centroid</varname> provided by PostGIS. For example, given set of objects that move together (that is, a convoy or a flock) the temporal centroid will produce a temporal point that represents at each instant the geometric center (or the center of mass) of all the moving objects.</para></listitem>
Expand Down
20 changes: 20 additions & 0 deletions meos/src/general/temporal.c
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,26 @@ tpoint_out(const Temporal *temp, int maxdd)
}
#endif /* MEOS */

/*****************************************************************************/

/**
* @ingroup meos_internal_temporal_inout
* @brief Return the Well-Known Text (WKT) representation of an array of
* temporal values
* @param[in] temparr Array of temporal value
* @param[in] count Number of elements in the input array
* @param[in] maxdd Number of decimal digits
*/
char **
temparr_out(const Temporal **temparr, int count, int maxdd)
{
assert(temparr); assert(count > 0); assert(maxdd >=0);
char **result = palloc(sizeof(text *) * count);
for (int i = 0; i < count; i++)
result[i] = temporal_out(temparr[i], maxdd);
return result;
}

/*****************************************************************************
* Constructor functions
****************************************************************************/
Expand Down
Loading

0 comments on commit 453de85

Please sign in to comment.