23 Commits

Author SHA1 Message Date
Nyall Dawson
a87ca09e34 Move some temp file/folder utils to c++ 2017-06-22 06:48:25 +10:00
Nyall Dawson
60ea095d01 Port calculation of iterating destination to c++ 2017-06-12 13:35:17 +10:00
Nyall Dawson
d7aa3f5f7c [processing] Change explicit encoding string parameters to more
flexible QVariantMap creatOptions parameters which include an
optional fileEncoding value

More flexible, allows sinks to be created using any creation
option which is passed to the underlying provider
2017-06-06 08:00:28 +10:00
Nyall Dawson
0e991bf62c Remove QgsProcessingUtils::uniqueValues
Use QgsFeatureSource method instead
2017-06-06 07:41:20 +10:00
Nyall Dawson
b6fb41d4ee [processing] Don't use vector layers directly as feature sources
Instead, parameters evaluate to QgsFeatureSource, which are
used for retrieving features, feature count, crs, wkb type,
etc.

This abstracts away the actual feature source, so that
algorithms may potentially operate from non-layer
feature sources.

It also helps remove the need for specialised QgsProcessingUtils
methods like getFeatures, featureCount, and createSpatialIndex.
Instead the standard API methods using QgsFeatureSources can
be used instead.
2017-06-06 07:41:20 +10:00
Nyall Dawson
ba03f1a13a Move minimum layer extent calculation to c++ 2017-06-06 07:41:19 +10:00
Nyall Dawson
6aa10c6817 [processing] Cleanup some layer/writer related handling
Ensure that layers created by QgsProcessingUtils::createFeatureSink
can always be retrieved using QgsProcessingUtils::mapLayerFromString
2017-05-09 15:29:41 +10:00
Nyall Dawson
a8a3cc82ed [processing] Port vector.createVectorWriter to c++
This implements an improved version of vector.createVectorWriter
in QgsProcessingUtils. The improved version relies on the
core class QgsVectorLayerImport to create empty layers,
which:
- reduces duplicate code and reuses the mature QgsVectorLayerImport
routines
- avoids manual conversion of field types to destination provider
field types
- potentially allows any writable provider to be used as a feature
sink for algorithms (e.g. output direct to MSSQL/Oracle/db2). This
should work now - it just needs exposing via UI.
2017-05-07 08:02:53 +10:00
Nyall Dawson
df1ead5ed4 [processing] Remove vector.spatialindex()
Use QgsProcessingUtils.createSpatialIndex() instead.
2017-05-02 13:39:36 +10:00
Nyall Dawson
600518de72 Add unit tests for QgsProcessingUtils::mapLayerFromString 2017-05-02 12:33:22 +10:00
Nyall Dawson
11fb72eef7 Only expose a single mapLayerFromString method in QgsProcessingUtils 2017-05-02 12:33:22 +10:00
Nyall Dawson
f84d703234 Add method QgsProcessingUtils::mapLayerFromString
Algorithms and other processing code should use this method
(instead of dataobjects.getLayerFromString) to
retrieve layers from a string, as it considers the processing
context and allows resolving strings to temporarily stored layers.

This permits processing models to function correctly when
intermediate results are stored as memory layers. Subsequent
model algorithms can then access these temporary layers as inputs.
All temporary layers will be removed when the context object
is destroyed after the model algorithm is run.
2017-05-02 12:33:04 +10:00
Matthias Kuhn
28a21209b9 [sipify] seealso 2017-04-30 16:52:05 +02:00
Nyall Dawson
f247a7cda3 Add c++ optimised uniqueValues method which respects processing context
Remove processing vector.uniqueValues/vector.getUniqueValues
and port usage to c++ method

Should be much faster than the python method, as the c++ method takes
advantage of handing off the unique values calculation to the
provider source whenever possible
2017-04-26 12:53:35 +10:00
Nyall Dawson
b32b39501e Add methods for getting vector iterators to QgsProcessingUtils 2017-04-26 12:53:35 +10:00
Denis Rouzaud
c1832854a2 sipify batch
* QgsDial
* QgsDialog
* QgsDockWidget
* QgsEncodingFileDialog
* QgsErrorDialog
2017-04-25 13:46:56 +02:00
Denis Rouzaud
1bfa539df1 [sipify] remove extra blank line 2017-04-24 07:39:30 +02:00
Denis Rouzaud
8f2a5c7c00 sipify all 2017-04-20 14:21:36 +02:00
Nyall Dawson
eff5a823c9 [sipify] Convert "\a arg" to "`arg`" when processing Docstrings
Allows argument names to be highlighted in Python docs
2017-04-17 13:49:59 +10:00
Nyall Dawson
bfd37e1122 [sipify] Add return types for functions in docstrings
and change \return -> :return: in docystrings
2017-04-08 09:48:48 +10:00
Matthias Kuhn
58d2d6d7f9 sipify_all 2017-04-07 12:26:30 +02:00
Nyall Dawson
377b181c4e Port more processing dataobjects methods to c++
Also
- simplify and add tests
- remove large memory leak (persistant store of all non-project layers)
- remove broken support for direct loading postgres/virtual layers
by string (Python version was very broken and would never match
a postgres/virtual layer)
2017-04-05 19:50:46 +10:00
Nyall Dawson
8ffdb362cc Port some processing dataobjects routines to c++ 2017-04-05 15:27:17 +10:00