5287 Commits

Author SHA1 Message Date
Alessandro Pasotti
7a1b9f970b DBManager -> Browser synchronization
Reload/refresh the browser tree and source select connection
items when connections, tables etc. change in the DBManager

Note that this is uni-directional: changes in the browser tree
are not (yet) propagated to the DBManager
2017-09-15 17:08:11 +02:00
Nyall Dawson
5bd164b644 Merge pull request #5200 from nyalldawson/drop_handler
[FEATURE][processing] Allow dropping model files onto QGIS window to execute them
2017-09-15 19:42:46 +10:00
Nyall Dawson
f282a753c6 [processing] Fix incorrect filters in vector layer parameter selections 2017-09-15 19:41:19 +10:00
Nyall Dawson
6300464275 [FEATURE][processing] Allow drag and drop of model files onto QGIS window
to execute them
2017-09-15 18:39:51 +10:00
Nyall Dawson
c5ae3a0c98 Merge pull request #5199 from nyalldawson/extract_by_extent2
[processing] Extent handling improvements
2017-09-15 15:52:00 +10:00
Nyall Dawson
4fd2a1a05c Fix unit test data 2017-09-15 12:23:36 +10:00
Nyall Dawson
60b56db904 Use CRS when calculating extent during algorithm extection 2017-09-15 08:35:11 +10:00
Nyall Dawson
80a1d71131 Return a referenced rectangle from ExtentSelectionPanel 2017-09-15 08:34:47 +10:00
Nyall Dawson
74565e22de Nicer display of rectangle parameter values 2017-09-15 08:34:13 +10:00
Nyall Dawson
d8db3ecc4d [FEATURE] New processing algorithm "extract/clip by extent"
Allows extract a subset of another layer using an extent, with
optional setting to clip geometries to the extent
2017-09-15 08:33:19 +10:00
Giovanni Manghi
3a78253764 fix SAGA LTR vectorizing grid classes tool for QGIS master 2017-09-14 21:03:56 +01:00
Alessandro Pasotti
d8940544f7 [bugfix] Geopackage restore connections in DB-manager 2017-09-14 13:39:44 +02:00
Nyall Dawson
d96a3f4dd4 Port simplify geometries to c++ 2017-09-14 09:57:15 +10:00
Nyall Dawson
8e8f3edc55 Port merge lines and smooth to c++ 2017-09-14 09:57:15 +10:00
Nyall Dawson
7c5521ecdf Port fix geometries alg to c++ 2017-09-14 09:57:15 +10:00
Nyall Dawson
bf078b1c84 [processing] Fix intersection and union tools don't work with
input layers with Z or M values present

Also ensure that written geometries are always multitype, to
match the created layer geometry type (before the layer was
being created as a multi* layer, but single part geometries
were sometimes created. This causes errors with some data
providers)
2017-09-14 07:35:54 +10:00
Nyall Dawson
c371b72dfe Merge pull request #5184 from nyalldawson/join_locate
[FEATURE] Reworked processing 'Join by location' alg
2017-09-14 06:09:56 +10:00
Nyall Dawson
742f3e5b4d Merge pull request #5112 from nyalldawson/locator_core
Move locator non-gui classes to core
2017-09-13 18:50:28 +10:00
Nyall Dawson
be88da8173 [FEATURE][processing] Add 'Join by location (summary)' algorithm
Like the main Join Attributes by Location algorithm, this algorithm
takes two layers and combines the attributes based on a spatial
criteria.

However this algorithm calculates summaries for the attributes for
all matching features, e.g. calculating the mean/min/max/etc.

The list of fields to summaries, and the summaries to
calculate for those, can be selected.
2017-09-13 18:45:56 +10:00
Nyall Dawson
458e994d39 [FEATURE] Reworked processing 'Join by location' alg
Improvements:
- transparently handle different source/join CRS
- added option to create output feature for EVERY joined
feature (i.e. 1 to many type join)
- added option to select joined fields to take
- optimised performance of algorithm

The previous option to create a summary of joined features has been
removed, and will be moved to a separate 'Join by location (summary)'
algorithm.
2017-09-13 08:01:56 +10:00
Nyall Dawson
cf16a82419 Fix indentation 2017-09-12 19:23:37 +10:00
Nyall Dawson
4a974eab18 Cleanup model algorithm parameter definition dialog 2017-09-12 17:12:13 +10:00
Nyall Dawson
8fcad6aed9 [processing] List 'All files (*.*)' option last in save as dialogs
See https://ux.stackexchange.com/questions/111689/file-dialog-formats-list-should-all-files-be-listed-first-or-last for discussion:

- for 'file open' dialogs, wildcard options should be listed first
- for 'file save' dialogs, wildcard options should be listed last
2017-09-12 10:20:52 +10:00
Nyall Dawson
a650681061 Merge pull request #5131 from nyalldawson/location_algs
Rework Select by Location algorithm
2017-09-11 15:50:43 +10:00
Nyall Dawson
7f5bd00cbf Merge pull request #5154 from nyalldawson/stats
[processing] Improve Stats by Categories algorithm, remove duplicate algs
2017-09-11 15:50:16 +10:00
Nyall Dawson
6a760ef3df More tests for Extract by Location 2017-09-10 10:50:55 +10:00
Nyall Dawson
e0026609bb Fix missing geometries/attributes in Extract by Location 2017-09-10 10:45:34 +10:00
Nyall Dawson
640a27b4ea Drop python Select/Extract by Location algs 2017-09-08 20:34:52 +10:00
Nyall Dawson
f4b9bbd8ab Swap unit tests to use native algorithms 2017-09-08 20:32:12 +10:00
Alexander Bruy
1fb48f456c [processing] fix file filter construction for output files 2017-09-08 11:56:23 +03:00
Nyall Dawson
a9f4540081 Remove 'precision' option from spatial relation processing algs
Rationale:
- the correct use for this option is unclear, and users are
mistakenly using it as a 'tolerance' option
- it's very likely to generate invalid geometries as a result
of the snapping, causing unreliable results

Given these substantial issues, it's safer to remove this
option and require that users who need the snap to grid
precision change explicitly do this via an extra model
step before running the algorithm.
2017-09-08 16:48:59 +10:00
Nyall Dawson
24a4ab7f0d Rework Select by Location algorithm
Changes:

- handle different CRS transparently

- don't build a spatial index on the selection layer. Instead
only use feature requests to fetch features which are within
the desired bounds, and rely on the presence of an appropriate
spatial index at the provider's backend. Otherwise, we force
every user of this algorithm to have a full iteration of the
source table, regardless of how large the table is. That means
that trying to select a set of addresses which fall within
a specific locality from a table which contains the addresses
for a whole state will FORCE every address in the state to
be initially read before any calculation begins. With this
change only those features within the bounding box of the
selected localities will ever be fetched from the provider,
resulting in huge speed improvements for the algorithm.

- use prepared geometries for the spatial relation tests.
This dramatically speeds up the algorithm in the case
where the intersection layer features cover multiple
features from the 'selection' layer.

- Add a 'select within current selection' mode

- Optimise feature requests for efficiency (especially
with respect to the 'disjoint' selection mode)
2017-09-08 16:48:59 +10:00
Nyall Dawson
4ca972a2ff Fix stats by categories tests on Travis 2017-09-08 16:35:18 +10:00
Nyall Dawson
c750cb2154 Fix existing unit test, add new tests 2017-09-08 09:21:02 +10:00
Nyall Dawson
9a091651bc [FEATURE] Drop 'Frequency analysis' and 'Number of unique values in classes' algs
The functionality of both these algorithms is available in 'stats by
categories'
2017-09-08 08:52:42 +10:00
Nyall Dawson
ea2e537cd7 Make value field in 'Stats by category' optional
If not set, only the feature counts for each category will
be calculated
2017-09-08 08:52:42 +10:00
Nyall Dawson
30c663eaef Fix calculation with null strings 2017-09-08 08:52:42 +10:00
Nyall Dawson
30866190e9 [FEATURE] Allow multiple category fields in 'stats by category' 2017-09-08 08:52:42 +10:00
Nyall Dawson
4e78e034a1 [FEATURE] Improve Stats by Categories algorithm
- allow non spatial inputs
- allow calculation of stats on any field type, with specific
string and datetime stats calculated when field type matches
- output a full set of stats for numeric fields (including median
, quartiles, etc)
- also calculate stats for 'null' category
2017-09-08 08:52:42 +10:00
Richard Duivenvoorde
117261bfb7 Fix for #17104 2017-09-05 14:16:48 +02:00
Nyall Dawson
7627851026 Fix bad strings 2017-09-05 19:46:49 +10:00
Nyall Dawson
a55fbd8ef3 [FEATURE] Remove Singleparts to Multiparts algorithm
This algorithm is no longer required - it's been replaced by
the 'Promote to multipart' and 'Collect geometries" algorithms.

Tagged as feature to remember to include in release notes
2017-09-05 19:41:28 +10:00
Nyall Dawson
16c4f830b3 [FEATURE] New algorithm for 'collecting' geometries
This is basically the equivalent of the dissolve algorithm, but
instead of a dissolving overlapping geometries the geometries
are instead just collected together into a multipart geometry.

It's designed to slot between the 'promote to multipart' algorithm
(which performs no collection of geometries - it just converts
singleparts to multiparts with 1 part) and the more complex
all-encompassing 'aggregate' algorithm.
2017-09-05 19:41:27 +10:00
Nyall Dawson
3484eb019c [FEATURE] Native 'Promote to Multipart' algorithm
This algorithm is basically the equivalent of the ST_Multi(...)
command - it forces a feature's geometry to become multipart,
regardless of the input geometry type.

If input geometries are singlepart, they will output as
multipart with just 1 part. If they are already multipart,
they will be output unchanged.
2017-09-05 19:40:35 +10:00
Alexander Bruy
b5bb7df7eb Merge pull request #5111 from nyalldawson/min_bounding_geom_alg
[FEATURE] New processing algorithm "minimum bounding geometry"
2017-09-05 11:58:15 +03:00
Nyall Dawson
d08398f785 [FEATURE] Drop processing 'Select by Attribute Sum' algorithm
Tagged as feature to be included in release notes.

Because:

- The use case for this algorithm is very unclear for users - the name
does not describe what the algorithm does, and there's no help
documentation available for the algorithm either. Given this I suspect
that the algorithm is not being put into use.

- The algorithm needs enhancement to be more useful. There's no logic
in place which dictates how neighbouring features are chosen to
dissolve into the selected feature (it's effectively random - you're
just as likely to get a huge narrow polygon stretching across a map as
you are a nice compact cluster). To be more useful the algorithm would
need logic to either minimise the area of the dissolved feature, or
minimise the total number of dissolved features, or ... ?
2017-09-05 17:22:11 +10:00
Nyall Dawson
ddb3198ef2 Add some more debugging to processing algorithm test
Trying to pinpoint which algorithm occasionally segfaults during
test runs
2017-09-05 09:18:16 +10:00
Nyall Dawson
fadfb3562a Fix error when adding disabled plugin based processing providers 2017-09-04 11:16:17 +10:00
Nyall Dawson
f01ad63bba Rename 'Polygon from layer extent' to 'Extract layer extent'
It's slightly simpler to understand and better reflects
what this alg does
2017-09-04 08:45:10 +10:00
Nyall Dawson
5d504dcafb Unify processing "polygon from layer extent" algorithms
Now that the extra features of the "polygon from vector layer extent"
algorithm are covered by the new "Minimum bounding geometry" algorithm,
we can replace the previous two "polygon from vector extent" and
"polygon from raster extent" algorithms by a single "polygon
from layer extent" algorithm.
2017-09-04 08:42:03 +10:00