53 Commits

Author SHA1 Message Date
Bas Couwenberg
2628c480c5 Don't include revision in sources.
Prevent changes to files that weren't changed between releases.
This eases review of the changes between releases significantly.
2019-05-17 16:47:47 +02:00
Nyall Dawson
9e1bf68902 [processing] Fix pixel centroids along lines handling of null geometries 2018-12-18 04:38:42 +10:00
Alexander Bruy
821a8ff0b5 [processing] fix incorrect output names 2018-08-26 11:26:07 +03:00
Nyall Dawson
74b0e910db [processing] Fix some exceptions 2018-05-16 04:35:17 +10:00
Nyall Dawson
249dca7830 [processing] Consist helpful error messages when sinks cannot be created
And throw exceptions always when sinks are not created to avoid
generic errors
2018-04-28 05:50:47 +10:00
Nyall Dawson
5339d62715 [processing] More helpful errors when sources cannot be loaded
Include descriptive text with the specified parameter value
in error, and always check that sources were loaded to avoid
raw Python exceptions when they are not
2018-04-28 05:50:47 +10:00
Nyall Dawson
6528f1c307 Require a transform context when setting the destination crs for
a feature request

Forces correct datum handling for these requests, and removes
a few more uses of the deprecated/datum unaware transforms.
2017-12-20 12:32:20 +10:00
Alexander Bruy
dca37abd0e [processing] add group id to QGIS algorithms 2017-12-14 18:04:12 +02:00
Alexander Bruy
3d4a59bb8b [processing] cleanup files from unused code and remove some files 2017-11-28 12:27:45 +02:00
Alexander Bruy
0059b2b692 [processing] remove Python 2 compatibility layer 2017-11-28 12:27:45 +02:00
Matthias Kuhn
e0025b65b1
Rename QgsGeometry::fromPoint to QgsGeometry::fromPointXY
Also introduces the from[Geometry]XY for QgsGeometryFactory
2017-10-30 09:14:06 +01:00
Nyall Dawson
2a442c7886 Rationalise algorithm groups a bit 2017-08-22 23:36:42 +10:00
Nyall Dawson
47fe2a182d Port Points From Lines to new API 2017-08-14 01:42:16 +10:00
Nyall Dawson
1e13d733c2 Move declaration of algorithm parameters/outputs to a new virtual
initAlgorithm() method

This allows 2 benefits:
- algorithms can be subclassed and have subclasses add additional
parameters/outputs to the algorithm. With the previous approach
of declaring parameters/outputs in the constructor, it's not
possible to call virtual methods to add additional parameters/
outputs (since you can't call virtual methods from a constructor).

- initAlgorithm takes a variant map argument, allowing the algorithm
to dynamically adjust its declared parameters and outputs according
to this configuration map. This potentially allows model algorithms which
can be configured to have variable numbers of parameters and
outputs at run time. E.g. a "router" algorithm which directs
features to one of any number of output sinks depending on some
user configured criteria.
2017-07-10 16:31:14 +10:00
Nyall Dawson
b1cadb1822 Use generic algorithm icon for qgis algorithms which do not
have specific icons, instead of generic qgis icon

We consider these 'top level' algorithms, and using the
standard algorithm icon should help reflect this and
differentiate them from 3rd party algorithms.
2017-06-24 12:01:20 +10:00
Nyall Dawson
81855a715b Use FastInsert when adding features from processing 2017-06-23 14:34:38 +10:00
Nyall Dawson
99cfb8faf3 Fix processing algs crash when no source features exist
Instead we output an empty layer - this may be critical for
multi-step models where there is validly no features present
in a source layer
2017-06-23 13:49:32 +10:00
Nyall Dawson
f64f74fb63 Fix incorrect import 2017-06-06 13:41:42 +10:00
Nyall Dawson
4cb7d18b1c Push parameters into processAlgorithm and related functions 2017-06-06 07:41:19 +10:00
Nyall Dawson
77ab933788 Move alg character definitions to __init__ 2017-06-06 07:41:19 +10:00
Nyall Dawson
168f16276c Remove help related methods from GeoAlgorithm 2017-06-06 07:41:19 +10:00
Matthias Kuhn
a9d7630a69 Rename QgsPointV2 to QgsPoint and QgsPoint to QgsPointXY
Because 3D coordinates should be the default.

References https://github.com/qgis/qgis3.0_api/issues/36
2017-06-02 19:53:37 +02:00
Nyall Dawson
15de36ab26 [processing] Always require real QgsFields objects in getVectorWriter,
don't allow arrays of fields as inputs
2017-05-03 06:26:12 +10:00
Nyall Dawson
877775d2c0 Remove a bunch of unneeded imports 2017-05-02 14:47:58 +10:00
Nyall Dawson
49c688bbe4 Fix use of QgsProcessingUtils.mapLayerFromString 2017-05-02 13:40:49 +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
Nyall Dawson
fd2c18ee16 Refactor processing writer to use QgsFeatureSink, and to store
temporary output layers in the provided processing context

Should fix loss of intermediate memory layers when running
a multi-step model
2017-04-26 17:38:40 +10:00
Nyall Dawson
427c3b1684 Remove vector.features
Use QgsProcessingUtils.getFeatures instead
2017-04-26 12:53:35 +10:00
Nyall Dawson
6397386fda Remove len method from vector.features
Use QgsProcessingUtils::featureCount instead
2017-04-26 12:53:35 +10:00
Nyall Dawson
adc7cf0ec2 Add context argument to vector.features 2017-04-26 12:53:35 +10:00
Nyall Dawson
dd4f530cfb [processing] Pass context argument to processAlgorithm 2017-04-26 12:53:35 +10: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
a0bd464232 Use formatted name for algorithm names
Avoids conversion of names later and gives clearer separation
between visible names and internal names
2017-04-03 21:17:45 +10:00
Nyall Dawson
6987d7b37c Port handling of algorithm names to QgsProcessingAlgorithm 2017-04-03 21:17:45 +10:00
Nyall Dawson
dc729c1b5a Move algorithm group handling to QgsProcessingAlgorithm 2017-04-03 21:17:45 +10:00
Nyall Dawson
faa8a653b2 Move algorithm icon handling to QgsProcessingAlgorithm 2017-04-03 21:17:45 +10:00
Juergen E. Fischer
c77172ed3d fix more flake8 warnings 2017-03-05 10:21:24 +01:00
Nyall Dawson
ede452be85 [processing] Port feedback object to c++
Algorithms are now passed a QgsProcessingFeedback object
instead of the loosely defined progress parameter.
2017-01-11 11:11:10 +10:00
Juergen E. Fischer
31df84aa6b run 2to3 on source 2016-09-21 23:30:04 +02:00
Alexander Bruy
65db336eaf [processing] move some constants to the dataobjects module 2016-09-02 09:28:45 +03:00
Alexander Bruy
80653c7aff [processing] adopt native algs to use output geomerty 2016-09-02 09:28:32 +03:00
Matthias Kuhn
bb79d13e82 Remove deprecated Qgis::WKBType and API cleanup (#3325)
* Remove deprecated Qgis::WKBType and API cleanup

Renames QgsWKBTypes to QgsWkbTypes

Replaces usage of the enums:

* Qgis::WKBType with QgsWkbTypes::Type
* Qgis::GeometryType with QgsWkbTypes::GeometryType

Their values should be forward compatible (a fact that was already
explited up to now by casting between the types)

Renames some SSLxxx to SslXxx and URIxxx to UriXxx

* Fix build warnings and simplify type handling

* Add a fixer to rewrite imports

* The forgotten rebase conflictThe forgotten rebase conflicts

* QgsDataSourcURI > QgsDataSourceUri

* QgsWKBTypes > QgsWkbTypes

* Qgis.WKBGeom > QgsWkbTypes.Geom

* Further python fixes

* Guess what... Qgis::wkbDimensions != QgsWkbTypes::wkbDimensions

* Fix tests

* Python 3 updates

* [travis] pull request caching cannot be disabled

so at least use it in r/w mode

* Fix python3 print in plugins
2016-08-04 09:10:08 +02:00
Nyall Dawson
1a2231f10c Rename QGis class to Qgis, for capitalisation consistency 2016-07-21 22:01:38 +10:00
Denis Rouzaud
8071acd064 move PyQt compat folder to python/qgis 2016-04-29 14:10:26 +02:00
Juergen E. Fischer
2526d3e3c8 processing: switch to pyqt wrappers, flake8 fixes 2016-03-21 17:00:25 +01:00
Alexander Bruy
e7fe61e6b9 [processing] load algorithms only when requred 3rd party modules are
available or compatible QGIS version is used

Some housekeeping in QGIS algorithms provider
2016-02-17 14:46:02 +02:00
Juergen E. Fischer
b39055b39c indentation update (now including autopep8) 2015-08-22 14:29:41 +02:00
Juergen E. Fischer
66a3d02240 integrate processing into update_ts.sh (also includes all translations
in the repository and none outside of it).
2015-07-26 04:28:37 +02:00
pcav
7dacddc08a Uniform and informative output names for Processing (QGIS, Take #1) 2015-05-22 15:56:45 +02:00
Juergen E. Fischer
956c155e8f fix python pep8 warnings and fix some revealed errors
pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701 \
     --exclude="ui_*.py,debian/*,python/ext-libs/*" \
     .
2015-02-01 20:46:47 +01:00