This commit adds a number of different forms of aggregates to
the expression engine.
1. Aggregates within the current layer, eg sum("passengers")
Supports sub expressions (ie sum("passengers"/2) ), group by
( sum("passengers", group_by:="line_segment") ), and optional
filters ( sum("passengers", filter:= "station_class" > 3 ) )
2. Relational aggregates, which calculate an aggregate over
all matching child features from a relation, eg
relation_aggregate( 'my_relation', 'mean', "some_child_field" )
3. A summary aggregate function, for calculating aggregates
on other layers. Eg aggregate('rail_station_layer','sum',"passengers")
The summary aggregate function supports an optional filter,
making it possible to calculate things like:
aggregate('rail_stations','sum',"passengers",
intersects(@atlas_geometry, $geometry ) )
for calculating the total number of passengers for the stations
inside the current atlas feature
In all cases the calculations are cached inside the expression
context, so they only need to be calculated once for each
set of expression evaluations.
Sponsored by Kanton of Zug, Switzerland
Can be used to store the results of expensive sub-expression
calculations (eg layer aggregates), so that future expression
evaluation using the same context does not have to recalculate
the cached values.
In https://codereview.qt-project.org/#/c/99815/ implemented in QT 5.5,
doubles are converted to strings using '%.17g', so short decimal values
might be expanded to long strings depending on their values.
https://wiki.qt.io/New_Features_in_Qt_5.7 has a logic to avoid this, but
if we select carefully the double to have both an exact binary and decimal
representation, that can work will all versions.
$ python -c "print('%.17g' % 9.7)"
9.6999999999999993
$ python -c "print('%.17g' % 1.25)"
1.25
The GNU/Hurd porting guidelines document the following:
"
Missing termio.h
Change it to use termios.h (check for it properly with autoconf
HAVE_TERMIOS_H or the __GLIBC__ macro)
Also, change calls to ioctl(fd, TCGETS, ...) and ioctl(fd, TCSETS, ...)
with tcgetattr(fd, ...) and tcsetattr(fd, ...).
"
https://www.gnu.org/software/hurd/hurd/porting/guidelines.html#Missing_termio_h_tt_