mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
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
Updating the srs.db ------------------- The srs.db can be updated from the EPSG codes in the GDAL installation: 1) Install latest GDAL, be sure to configure with --with-python. 2) Set PATH and PYTHONDIR if installed GDAL in non-standard location. 3) Run 'scripts/qgis_srs.sh > new_srs.sql'. It may take a minute or two. 4) Run 'sqlite3 new_srs.db < new_srs.sql'.' 4) Run 'sqlite3 new_srs.db <postprocess_srs.sql' You can use sqlite3 to dump the contents from both srs.db and new_srs.db before you decide to commit. Magnus Homann 2009-08-19