10510 Commits

Author SHA1 Message Date
Nyall Dawson
f799d3afc8 Move allFeatureIds from QgsVectorLayer to QgsFeatureSource 2017-09-08 20:09:29 +10:00
Alexander Bruy
1fb48f456c [processing] fix file filter construction for output files 2017-09-08 11:56:23 +03:00
Alessandro Pasotti
f0e021c2fd Merge pull request #5000 from jgrocha/add-default-layers
[FEATURE][needs-docs] Add XYZ connection to provide default OpenStreetMap tiles
2017-09-08 10:40:45 +02: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
e9fd409552 Allow multiple primary key fields to be specified for processing tests
`
2017-09-08 16:33:55 +10:00
lbartoletti
5c3a72014a fix qgsgeometry sip 2017-09-08 08:06:21 +02:00
lbartoletti
629f46d308 add overload methods 2017-09-08 08:06:21 +02: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
Alessandro Pasotti
31b51178b8 Added static QgsLayerItem::iconName(LayerType) for reuse and consistency 2017-09-07 16:12:01 +02:00
Blottiere Paul
456ca000a7 Rename methods 2017-09-06 15:22:39 +01:00
Blottiere Paul
8a17a608e1 Trust is now a project option instead of a global option 2017-09-06 15:22:38 +01:00
Blottiere Paul
7ef2e7046e Some cleanup and renaming 2017-09-06 14:46:37 +01:00
Blottiere Paul
eb725f3305 Do not update extent by default if trust project option is activated 2017-09-06 14:46:37 +01:00
Blottiere Paul
384e85ca77 Add option on layer to read extent from xml in case of data source without metadata 2017-09-06 14:46:37 +01:00
Matthias Kuhn
f0cf4c3ee8 Merge pull request #5137 from m-kuhn/expressionhistory
[FEATURE] History for attribute table form view display expressions
2017-09-06 11:36:04 +02:00
Nyall Dawson
f1313af914 Add some more unit tests 2017-09-06 11:25:17 +10:00
Nyall Dawson
f12bb74b58 Add missing docs 2017-09-06 11:25:16 +10:00
Nyall Dawson
6ab7ebadec Metatype Qgs(Referenced)Rectangle/PointXY 2017-09-06 11:25:16 +10:00
Nyall Dawson
1194b5abea Use inheritance rather than composition for QgsReferencedGeometries
See https://github.com/qgis/QGIS/pull/4720#issuecomment-308652392
for discussion of the rationale
2017-09-06 11:25:16 +10:00
Nyall Dawson
e926f345e8 Update sip 2017-09-06 11:25:16 +10:00
Denis Rouzaud
8053b96ec0 fix constructor and skip method with same python signature 2017-09-06 11:25:16 +10:00
Nyall Dawson
1a961e8045 Template based referenced geometry class 2017-09-06 11:25:16 +10:00
Nyall Dawson
26b9c043b4 Merge pull request #5116 from nyalldawson/remove_transect
Remove QgsTransectSample
2017-09-06 04:22:00 +10:00
Alessandro Pasotti
5f5be25357 Merge pull request #5124 from boundlessgeo/providers_gui_config
Providers gui config
2017-09-05 19:27:47 +02:00
Matthias Kuhn
63d0a91566
[FEATURE] History for attribute table form view display expressions
It's possible to re-use the last 10 display expressions in the form view
of the attribute table.

The expressions will also be persisted in the project file.

Using fields will now show field aliases instead of column names where
available.
2017-09-05 18:18:15 +02:00
Alessandro Pasotti
41eccd1bf9 Sip updates for qgssourceselectprovider 2017-09-05 16:56:09 +02:00
Richard Duivenvoorde
117261bfb7 Fix for #17104 2017-09-05 14:16:48 +02:00
Matthias Kuhn
8efa9fa815 [FEATURE] Add "starts with" and "ends with" to multi attribute search 2017-09-05 14:15:38 +02:00
Nyall Dawson
655f121af5 Merge pull request #5129 from nyalldawson/collect
[processing] Rework 'singlepart to multipart' algorithm
2017-09-05 20:56:21 +10:00
Matthias Kuhn
4ea4478bad Thread safety for feature counter
Make sure that results from a feature counter will only be delivered on
the main thread and that they will be discarded if the layer is deleted
meanwhile.
2017-09-05 12:18:52 +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
a77950cbf6 SIP, indentation and documentation updates 2017-09-05 09:53:48 +10:00
Nyall Dawson
62dcd0dad5 Start work on undo/redo support for layouts 2017-09-05 09:39:22 +10:00
Nyall Dawson
1589b4e648 Implement some saving/restoring layout items to XML 2017-09-05 09:39:22 +10:00
Nyall Dawson
66e1cf04e6 Port methods to retrieve layout items 2017-09-05 09:39:22 +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
Alessandro Pasotti
e21630db42 Sipify 2017-09-04 21:08:11 +02:00
Alessandro Pasotti
884b58c56d Resistance is futile, you will be sipified 2017-09-04 17:35:48 +02:00