- add selectByRect( QgsRectangle&, SelectBehaviour) and
selectByIds( QgsFeatureIds, SelectBehaviour) for selecting
by rect and ids respectively, with options to add to selection/
remove from selection/intersect with current selection
- deprecate select( QgsRectangle ) and setSelectedFeatures in
favour of new methods
- add unit tests
Makes it simple for scripts to select by expression. The method
also accepts a parameter which dictates whether matching features
are added to an existing selection, removed from the selection
or intersected with the current selection.
The existing code from the select by expression dialog has been
moved to QgsVectorLayer, and optimised for maximum possible speed.
Also added unit tests.
- The group is renamed as 'Select fields to export and their export options'
- It has no longer a checkbox. It is just collapsible. So
QgsVectorLayerSaveAsDialog::attributeSelection() is deprecated and always
return true.
- For most formats, all attributes are selected by default
- For CSV/XLSX/ODS, if they have edit widgets, the corresponding checkbox in
"Replace with displayed values" column is also checked by default.
- For DXF, keep existing behaviour: attributes are unchecked and not checkable
- For KML, keep existing behaviour: attributes are unselected by default
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
Second part of qgis/QGIS-Enhancement-Proposals#53
(QEP 35: WFS provider enhancements)
- URI parameter with sql with SELECT / FROM / JOIN / WHERE / ORDER BY clauses
- handle WFS 2.0 joins
- handle DateTime fields
- enable "Only request features overlapping the view extent" by default (and memorize the settings)
- rework DescribeFeatureType parsing to handle responses with several documents, and some support for attribute types being complexType
- rework feature transfer between downloader and iterator so as to avoid uncontrolled RAM usage when the iterator cannot keep up with the downloader
- turn on WAL journaling for better reader / writer concurrency
- add retry logic based on the 'Max retry in case of tile request errors' setting (renamed 'Max retry in case of tile or feature request errors')
- error to MessageBar in case of failed download
- in progress dialog, add a "Hide" button to mask the dialog
- improve automated testing
- add testing of the GUI of QgsWFSSourceSelect