32908 Commits

Author SHA1 Message Date
Nathan
0ff10aeb0e [styledock] more widget changes 2016-05-18 09:50:49 +10:00
Nyall Dawson
e92dc26c68 Followup feeeaf0, add unit tests 2016-05-18 09:33:17 +10:00
Martin Dobias
feeeaf0e53 [FEATURE] Extend linestring geometries with reshape tool
If the reshape line starts or ends at a linestring geometry's
endpoint, such geometry will be extended (previously no action
would be done).
2016-05-18 09:23:30 +10:00
Nyall Dawson
b23bae74b2 Fix warning 2016-05-18 08:50:38 +10:00
Juergen E. Fischer
04176350ec fix about box (followup 0b940cac, fixes #14832) 2016-05-17 22:03:30 +02:00
Even Rouault
aa66bc6a20 Merge pull request #3076 from rouault/delimitedtext_qt5_fix
Delimited text provider: fix parsing of subset URL parameter with QT 5 and fix tests
2016-05-17 17:00:36 +02:00
Even Rouault
8ee697bf2d Vector layer save as: usability tunings related to attribute selection
- 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
2016-05-17 16:57:45 +02:00
arnaud.morvan@camptocamp.com
7847f971d4 Processing - Adapt RefactorFields to work on tables as well as vector layers 2016-05-17 14:16:16 +02:00
arnaud.morvan@camptocamp.com
afbe914114 Processing - Support OutputVector with no geometry in GUI 2016-05-17 14:16:16 +02:00
arnaud.morvan@camptocamp.com
fc5f70c6f5 Processing - Support tables with no geometry in OutputVector 2016-05-17 14:16:15 +02:00
arnaud.morvan@camptocamp.com
63d23d2905 Processing - Support no geometry in VectorWriter 2016-05-17 14:16:15 +02:00
Nathan
a5ef216fbc [styledock] Better layouts for marker widgets
- Grid vs Form layouts
- Align DD buttons for better look
2016-05-17 21:56:49 +10:00
Juergen E. Fischer
6663a4cc82 osgeo4w: add qt plugin directories to browser with grass (followup b758a8c) 2016-05-17 12:15:12 +02:00
volaya
a7f41dc4c5 [processing] do not reject string parameters if they contain an unparsable expresion 2016-05-17 08:06:56 +02:00
Nathan Woodrow
57dc3c7eff [mssql] Fix layer not showing with invalid geometry 2016-05-17 15:47:50 +10:00
Martin Dobias
7eb05e2c3c Fix composer map tests 2016-05-17 12:52:32 +08:00
Martin Dobias
deee8e290e [FEATURE] Composer map to follow a visibility preset (fixes #13418)
This adds a new option in composer map properties:
"Follow visibility preset" with a combo box to choose the active preset.

This is an alternative to "lock layers" (and "lock layer styles") functionality
which would just copy preset's configuration, while the new option links to preset.

The difference is that when a preset is updated, composer map will automatically
pick the new configuration when following the preset, while there is no update
if "lock layers" (and "lock layer styles") option is used.
2016-05-17 12:52:32 +08:00
Matthias Kuhn
8c402bcf42 Remove child features when parent's add feature form is cancelled 2016-05-17 06:35:55 +02:00
Nyall Dawson
307aabd66a [FEATURE] Aggregates for expressions
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
2016-05-17 10:53:25 +10:00
Nyall Dawson
ea066599a1 [relations] Add method to manager to retrieve relations by name
Also
- Begin unit tests for QgsRelationManager
- Make project optional when constructing QgsRelationManager
2016-05-17 10:53:25 +10:00
Nyall Dawson
84fc3c3b3d Implement method for caching values within expression contexts
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.
2016-05-17 10:53:24 +10:00
Nyall Dawson
821134ca91 Add method to convert string to aggregate type 2016-05-17 10:53:24 +10:00
Nyall Dawson
dcc047af49 Add possibility to handle aggregate calculation at data provider
(not implemented for any providers yet)
2016-05-17 10:53:24 +10:00
Nyall Dawson
50e41c8133 New utility class QgsAggregateCalculator, simplifies calculating
aggregates from vector layer fields and expressions
2016-05-17 10:53:24 +10:00
Nyall Dawson
1c45b940a8 Add calculation of number of null values to QgsStatisticalSummary 2016-05-17 10:53:04 +10:00
Nyall Dawson
4dea723cae Add methods to stats calculators to accept values one at a time
This can be more efficient for large quantities of values, since
it avoids the need to create a list of all values in advance
2016-05-17 10:52:06 +10:00
Even Rouault
2bbd5ca509 Fix look&feel of WFS SQL query composer on Mac 2016-05-17 00:33:20 +02:00
Even Rouault
902953ca9a Delimited text provider: fix parsing of subset URL parameter with QT 5 and fix tests
In Qt 4, QUrl::queryItemValue() decodes a value that contains %25 as %, whereas
it doesn't with Qt5.
2016-05-16 23:41:00 +02:00
Juergen E. Fischer
c198b1afe9 indentation fix 2016-05-16 16:59:29 +02:00
Nyall Dawson
858914eef5 Ensure that providers fetch geometry for a QgsFeatureRequest
with an expression filter which requires geometry
2016-05-16 23:09:18 +10:00
Matthias Kuhn
c0214bc301 Fix bug in edit virtual field
The index was transformed twice from field index to field origin index,
resulting in a corrupted index (most often being 0 in the end).
2016-05-16 15:04:23 +02:00
Juergen E. Fischer
b514f521e6 cppcheck fixes 2016-05-16 14:14:14 +02:00
Matthias Kuhn
ee533a7dea Add test for attribute table sorting 2016-05-16 11:16:13 +02:00
Matthias Kuhn
9080aa1988 Don't require a parent for QgsExpressionBuilderWidget 2016-05-16 11:16:13 +02:00
Matthias Kuhn
d07d9edda6 Allow sorting attribute table by expression 2016-05-16 11:16:13 +02:00
Nyall Dawson
11ee2fc809 Fix running unsaved script in console 2016-05-16 18:14:58 +10:00
Juergen E. Fischer
d64f47404b fix precise build 2016-05-16 08:48:36 +02:00
Juergen E. Fischer
3d44a1e6e2 fix windows build 2016-05-15 23:56:53 +02:00
Nyall Dawson
8fd86a6b87 Fix debug build 2016-05-16 07:53:19 +10:00
Nyall Dawson
5c7f4c7664 Merge pull request #3072 from rouault/qt5_fix_testqgsfield
Make qgis_fieldtest all Qt 5.X compatible
2016-05-16 07:04:43 +10:00
Even Rouault
c4819adea4 Merge remote-tracking branch 'rouault/fix_qt5_wfs_ogcutils_tests' 2016-05-15 21:30:56 +02:00
Even Rouault
202420c70a Make qgis_fieldtest all Qt 5.X compatible
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
2016-05-15 19:44:13 +02:00
Even Rouault
9a49c6aace Make ogcutils and WFS tests Qt 5 compatible 2016-05-15 19:17:58 +02:00
Even Rouault
bf91a8b61b WFS provider, connections dialog: change way that we select current index in the tree view of layers to be QT 5 compatible and not require showing the widget in tests 2016-05-15 19:17:57 +02:00
Nyall Dawson
63cab56839 Avoid iterating over temporary container 2016-05-15 20:50:45 +10:00
Nyall Dawson
a3d6227e2e Avoid detaching temporary containers 2016-05-15 20:50:44 +10:00
Nyall Dawson
e25ffc4781 Avoid unnecessary temporary container and double iteration over
containers by directly iterating over container itself, rather
then iterating over .keys()/.values()
2016-05-15 20:50:44 +10:00
Nyall Dawson
77c4ed5054 Use more efficient QString multiple arg variant rather then
chaining .arg calls
2016-05-15 20:50:44 +10:00
Nyall Dawson
239865b708 Add missing references to Q_FOREACH loops 2016-05-15 20:50:43 +10:00
Nyall Dawson
0b940caccc Use QString::at(0) instead of left(1), since it's more efficient
and doesn't allocate a QString
2016-05-15 20:50:43 +10:00