6723 Commits

Author SHA1 Message Date
Nyall Dawson
1c4811fa12 Add Is Not Null and Is Not Between type search/filters 2016-05-24 00:26:15 +10:00
Nyall Dawson
e00ea61be6 Add missing docs 2016-05-24 00:26:15 +10:00
Nyall Dawson
02c0174d41 Add a "Between" type search/filter in filter form mode
When Between searches are selected, two search widget wrappers
will be created to allow entry of the minimum/maximum allowed
values.
2016-05-24 00:26:15 +10:00
Nyall Dawson
026e352cd9 [FEATURE] Add a search widget wrapper for datetime widgets 2016-05-24 00:26:15 +10:00
Nyall Dawson
6d868598f5 Add an interderminant "empty" state for QgsDateTimeEdit 2016-05-24 00:26:14 +10:00
Nyall Dawson
195b4dee5a [FEATURE] Add search widget wrapper for check box widget 2016-05-24 00:26:14 +10:00
Nyall Dawson
ca5c7e2cd4 [FEATURE] Form based select/filter in attribute table
This commit adds a new mode to the attribute table dialog for searching
and filtering features. When activated (using a button on the toolbar
or by pressng CTRL+F), the dialog will switch to form view and all
widgets are replaced with their search widget wrapper variant.

Alongside each widget is a tool button with options for controlling
the search/filter behaviour for that field, eg "equal to", "not equal
to", "is null", "greater than", etc.., with the options presented
matching themselves to the corresponding field and widget type.

New buttons appear at the bottom of the form for either selecting
matching features (with options for add to selection/remove from
selection/select within current selection) or filtering features
in the table (with options for adding features to a current filter
or further restricting a current filter).

Sponsored by SIGE
2016-05-24 00:26:14 +10:00
Alexander Bruy
2f5c3a570a [processing] fix expressions handling in ParameterString (fix #14834)
Add initial set of tests for ParameterString
2016-05-23 14:28:10 +03:00
volaya
9074b14a74 [processing] fix to avoid interrupted system call exceptions in mac 2016-05-23 13:25:20 +02:00
Alexander Bruy
6207412bf7 [processing] restore CreateConstantRaster algorithm (fix #14860) 2016-05-23 12:41:45 +03:00
ninsbl
75c76f51f1 [processing] Don't round grass7 extent and resolution to integer
fix #14582
See: https://hub.qgis.org/issues/14582

The commit removes the a-flag when the grass region for raster analysis is set. The a-flag causes in some cases unwanted rounding of raster extend / resolution, and should not be set hardcoded in processing. It is usually used in combination with the "res" option.
For aligning the pixels of the GRASS region to a specific raster, the align option should be used (and not the a-flag). See: https://grass.osgeo.org/grass70/manuals/g.region.html
GRASS 6.4 algs do not use the a-flag either, which explains why this bug appears only for GRASS 7.
2016-05-23 08:49:29 +02:00
Nyall Dawson
726a013222 Flag old composer table classes as deprecated 2016-05-23 14:52:53 +10:00
Nyall Dawson
eb3a34cc92 Fix QgsComposerAttributeTableV2 setting displayed fields under qt5
Also don't run QgsComposerAttributeTable test when disable
deprecated flag is set.
2016-05-23 14:52:46 +10:00
Matthias Kuhn
dbb24e971e [processing tests] More tolerance in statistics test 2016-05-22 21:52:55 +02:00
Matthias Kuhn
ced7c27dcf [py3] Use __bool__ instead of __nonzero__ 2016-05-22 21:52:55 +02:00
Matthias Kuhn
7f3526be71 [processing tests] Cleanup layer registry before every new test 2016-05-22 21:52:55 +02:00
Nathan
3ace8e62fd [Style dock] Add support for raster layers 2016-05-22 20:45:24 +10:00
pcav
98ede7fecf Replaced Grid with Raster for coherence 2016-05-20 17:51:28 +02:00
Nyall Dawson
0fcff9f2a0 Allow direct QVariant creation from some QGIS metatypes 2016-05-20 09:48:18 +10:00
mhugent
bc1aa42f85 Merge pull request #3081 from mhugent/curve_segmentize_parameters
Curve segmentize parameters
2016-05-19 16:29:05 +02:00
Even Rouault
0078b33ed2 Merge pull request #3082 from rouault/vectorfilewriter_cleanup_and_encoding_improvement
Vectorfilewriter cleanup and encoding improvement
2016-05-19 14:53:38 +02:00
volaya
a19741b297 [processing] log errors in hook scripts 2016-05-19 13:45:18 +02:00
volaya
518f7dcf6b [processing] correctly switch to description tab if help tab exists 2016-05-19 13:45:17 +02:00
Even Rouault
3ee7d59e18 QgsVectorFileWriter::MetaData: add a compulsoryEncoding member
* Some formats require a compulsory encoding, typically UTF-8.
Change initMetadata() to indicate UTF-8 compulsory encoding for
GeoJSON, GeoRSS, GML, GPKG, GPX, KML, SQLite, SpatiaLite, FileGDB,
XLSX and ODS
* QgsVectorFileWriter::init(): make it override the user specified
encoding if the format has a compulsory encoding. And remove hard-coded
case for KML.
2016-05-19 11:38:42 +02:00
Marco Hugentobler
c0d12dcdeb [FEATURE]: possibility to set the segmentation tolerance (maximum angle or maximum difference) 2016-05-19 11:02:43 +02:00
Denis Rouzaud
1602c02df7 Merge pull request #3009 from pblottiere/magnifier
[FEATURE] add a map canvas magnifier
2016-05-19 06:30:07 +02:00
Nyall Dawson
23a3a7717e Cleaner API for selecting features in QgsVectorLayer
- 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
2016-05-19 12:30:32 +10:00
Nyall Dawson
1767d3b073 [processing] Use QgsVectorLayer::selectByExpression for select by expression alg 2016-05-19 10:40:18 +10:00
Nyall Dawson
b951d5a54d [FEATURE] new method QgsVectorLayer::selectByExpression(...)
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.
2016-05-19 09:11:00 +10:00
volaya
b4e2354163 [processsing] removed unused code 2016-05-18 15:14:29 +02:00
Blottiere Paul
d23a110cb6 move magnification in map settings 2016-05-18 14:40:41 +02:00
volaya
d390ebdceb [processing] show script in toolbox even if it contains errors 2016-05-18 14:24:46 +02:00
volaya
f001ac11f7 [processing] fixed repaint in set vector style algorithm 2016-05-18 14:24:45 +02:00
volaya
bfa90a9125 [processing] fixed toolbox updates 2016-05-18 12:08:34 +02:00
volaya
fc08535429 Merge pull request #3044 from arnaud-morvan/processing_output_vectortable
Processing - Output tables with no geometry through OutputVector
2016-05-18 11:05:23 +02:00
Martin Dobias
a9c1996bbc Merge pull request #3064 from wonder-sk/composer-map-follow-preset
Composer map to follow a visibility preset
2016-05-18 11:08:43 +08:00
Blottiere Paul
842be91e61 remove spin box background color 2016-05-18 02:01:28 +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
volaya
a7f41dc4c5 [processing] do not reject string parameters if they contain an unparsable expresion 2016-05-17 08:06:56 +02: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