137 Commits

Author SHA1 Message Date
Nyall Dawson
71ebdb8f69 [FEATURE] Optimise processing clip algorithm
Before the algorithm was written to optimise clipping a few
features against thousands of mask features. The revised algorithm
is optimised for clipping thousands of input features against
a few mask features.

Given that this second operation is much more likely, it makes
sense to optimise for this use case.

I've also applied some other optimisations like taking advantage
of spatial indexes on the providers, using prepared geometries
and also only applying an intersection operation if the geometry
isn't wholly contained by the mask geometry.

Benchmarks:

clipping roads layer with 1 million lines against 2 polygons

before: 5 mins 30 seconds
after: 10 seconds

clipping address layer with 5 million points against 2 polygons

before: 50 minutes
after: 30 seconds
2016-08-03 13:15:03 +10:00
Nyall Dawson
4bfdcf0927 Fix expected test data 2016-08-02 13:50:59 +10:00
Nyall Dawson
60147e8147 Remove use of constGeometry 2016-08-02 13:50:59 +10:00
Nyall Dawson
bb54b4f41a [FEATURE] Make processing dissolve algorithm accept multiple fields
This allows you to dissolve based on more than one field value
2016-08-02 11:54:02 +10:00
Nyall Dawson
0455b6600d [processing] Fix multipart to singlepart handling of null geometry 2016-08-02 11:53:11 +10:00
Nyall Dawson
ccfd4c36be [processing] Add test for dissolve using field values 2016-08-02 11:52:37 +10:00
Nyall Dawson
30fcaed634 [FEATURE][processing] New algorithm for merging connected lines
This algorithm joins all connected parts of MultiLineString
geometries into single LineString geometries.

If any parts of the input MultiLineString geometries are not
connected, the resultant geometry will be a MultiLineString
containing any lines which could be merged and any non-connected
line parts.
2016-08-02 11:51:44 +10:00
Nyall Dawson
bd7d913379 Refine QgsFeature geometry getters/setters
All pointer based methods have been removed.

Now we have only:

  void setGeometry( const QgsGeometry& geom )

and

  QgsGeometry geometry() const

Benefits include avoiding a whole lot of tricky pointer lifetime
issues, potential memory leaks, and finally closing #777, which
has survived for over 9 years!...

Impacts on PyQGIS code:
- no more need for the messy
  g = QgsGeometry( feature.geometry() )
  workaround, just use g = feature.geometry() instead
- IMPORTANT: you can no longer test whether a feature has geometry
 using `if f.geometry():`, since QgsFeature::geometry() will
 *always* return an object. Instead, use
 `if not f.geometry().isEmpty():`, or preferably the new method
 `if not f.hasGeometry():`

Fix #777
2016-08-01 16:25:46 +10:00
Nyall Dawson
2db7fca7a6 [processing] Add tests for clip algorithm 2016-07-14 08:05:59 +10:00
Nyall Dawson
9e1ddcb54d [processing] Allow modification of feature request when using
vector.features

Allows for optimising the request through subsets of attributes
or no geometry fetching
2016-07-13 12:06:41 +10:00
Alexander Bruy
a12152c724 Merge pull request #3238 from medspx/processing_g7_raster_tests
[processing] more grass7 unit tests and their fixes
2016-06-29 19:49:58 +03:00
Médéric RIBREUX
ef4a0d8d08 Move problematics tests at the end of tests... 2016-06-26 21:20:19 +02:00
Médéric RIBREUX
4140655f20 Remove 3 unit tests that don't perform well in osgeo4travis 2016-06-26 17:29:53 +02:00
Médéric RIBREUX
a1c541ee6d Add another bunch of tests for rasters 2016-06-26 16:13:39 +02:00
Sandro Santilli
57ff59aa2d Ignore files generated during "make check" 2016-06-16 18:38:36 +02:00
Sandro Santilli
e241ab9b01 Remove generated test files from repository
Fixes #14976
2016-06-16 18:27:33 +02:00
Médéric RIBREUX
bb94a179a9 Add new test data and a bunch of unit tests 2016-06-12 17:36:42 +02:00
Médéric RIBREUX
0cd4498658 Improve Test generation 2016-06-12 14:23:09 +02:00
Médéric RIBREUX
bf02d34f55 Blacklist qt5 tests for Travis 2016-06-11 16:25:03 +02:00
Médéric RIBREUX
dbd1050879 [Processing][Tests] Improve Processing GRASS7 testsuite 2016-06-11 11:27:23 +02:00
Nyall Dawson
fbc5e0fc8e Fix indentation 2016-06-07 11:11:59 +10:00
Marco Bernasocchi
f9ab7223fc [processing] ParameterTableMultipleField type added
This adds a widget with multiple column attributes selector
2016-06-03 09:27:51 +02:00
Alexander Bruy
25983ee331 [processing] fix .ui file loading (follow up b52828fac7) 2016-05-30 14:39:28 +03:00
Médéric RIBREUX
59faf95c1d Blacklist travis-ci qt5 tests and remove i.fft test 2016-05-29 09:00:16 +02:00
Médéric RIBREUX
8d1bec33a0 Exec things... 2016-05-29 09:00:16 +02:00
Médéric RIBREUX
ec6b29aa8c Remove NaN values from raster before hash calculation 2016-05-29 09:00:16 +02:00
Médéric Ribreux
235f986517 Fix qt5 travis build and update README for Processing tests 2016-05-29 09:00:16 +02:00
Médéric Ribreux
c867123f18 Fix exec statement for AlgorithmsTestBase.py
On travis-ci environment, Python version seems to be affected by [this bug](https://bugs.python.org/issue21591).
One way to fix it is to use the old statement instead of exec() function.
2016-05-29 09:00:16 +02:00
Médéric Ribreux
f6710de670 Fix rasterhashes value with osgeo4travis values 2016-05-29 09:00:16 +02:00
Médéric Ribreux
1945facd1d Temporary make Grass7Utils more verbose for more travis debug 2016-05-29 09:00:16 +02:00
Médéric Ribreux
8884cd715a Add ugly debug prints to try to find what is travis-ci problem... 2016-05-29 09:00:16 +02:00
Médéric RIBREUX
bc4b3a20a7 Fix i.at.corr test 2016-05-29 09:00:16 +02:00
Médéric Ribreux
03a8a8e507 Try without subfunction 2016-05-29 09:00:16 +02:00
Médéric Ribreux
cd7047cc7c Try this exec modification 2016-05-29 09:00:16 +02:00
Médéric Ribreux
6b8f943022 Fix i.atcor algorithm 2016-05-29 09:00:16 +02:00
Médéric Ribreux
b40d2ff3ba Add last set of tests 2016-05-29 09:00:16 +02:00
Médéric Ribreux
1f21af6672 Improve tests: add external file support into AlgorithmsTest 2016-05-29 09:00:16 +02:00
Médéric Ribreux
e70f9bcf0c Add first set of unit tests 2016-05-29 09:00:16 +02:00
Alexander Bruy
7014c9baa0 [processing] fix tests 2016-05-23 19:34:25 +02: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
Matthias Kuhn
dbb24e971e [processing tests] More tolerance in statistics test 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
Nyall Dawson
0332157d8a Partial revert 18b69d 2016-05-12 10:22:22 +10:00
Nyall Dawson
18b69d26ef Indentation 2016-05-11 23:02:34 +10:00
Matthias Kuhn
c1687abc80 Replace calls to deprecated assertEquals method 2016-05-03 09:18:27 +02:00
Matthias Kuhn
e9c41e8021 Improve processing test documentation 2016-04-18 15:18:14 +02:00
Matthias Kuhn
d283223c56 Python 3 update for processing tests 2016-04-14 12:15:12 +02:00
Alexander Bruy
b7a4e20627 [processing] add Rectangles, Ovals, Diamonds algorithm (fix #11575)
This is direct port of abandoned "Rectangles, Ovals and diamonds" plugin.
There are two algorithms: one uses fixed values and second — variable
values from attribute table. Test for fixed distance version included.
2016-04-13 12:33:08 +03:00
Matthias Kuhn
30df95aba6 Add new target port-plugins to run 2to3 on plugins as build step 2016-04-12 14:48:20 +02:00
Matthias Kuhn
fa90a7bb7c ogrinfo reports null geometry features differently 2016-04-09 09:48:46 +02:00