49 Commits

Author SHA1 Message Date
Nyall Dawson
86d33c1875 Restore frequency analysis script
This script has been changed to use a sink output, not the previous
TableWriter csv output.

All algorithms which output flat tables should now still output
feature sinks, to allow correct use in later model steps.
2017-06-27 08:33:13 +10:00
Nyall Dawson
a72eea2256 Fix auto creation of variables when running script algorithms 2017-06-27 08:33:13 +10:00
Nyall Dawson
53e9538ad3 Restore keep n biggest parts script 2017-06-27 08:33:13 +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
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
06c4dea7ff [processing] Remove vector.createVectorWriter
Use QgsProcessingUtils.createFeatureSink instead
2017-05-07 08:02:54 +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
a4cd66f8d8 Port some more code to new API 2017-04-26 13:13:08 +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
Juergen E. Fischer
8bea742216 fix flake8 warnings 2017-03-13 20:13:51 +01:00
Denis Rouzaud
958dff9d82 spelling fixes 2017-01-25 17:38:01 +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
Nyall Dawson
6bb4934907 [FEATURE][processing] Remove duplicate create points along lines script
This functionality is duplicated by the PointsAlongGeometry algorithm

Keep the algorithm version, since it has unit tests and supports things
like progress reports.

(marked as feature for inclusion in release notes)
2016-11-30 09:35:06 +10:00
Nyall Dawson
d4c38f9277 [FEATURE][processing] Remove duplicate fill holes algorithm
The Fill_holes script is duplicated by the DeleteHoles algorithm,
and the DeleteHoles algorithm has many advantages:
- it's a full algorithm rather than a script
- uses qgis geometry classes and maintains curves/z/m
- has unit tests
- doesn't rely on non-standard external library (shapely)

(marked as feature for inclusion in release notes)
2016-11-30 09:32:57 +10:00
Martin Dobias
d729951dcd Remove caching of WKB from QgsGeometry (was kept just for compatibility)
Also improves the API to export/import WKB as QByteArray
2016-11-14 13:36:12 +08:00
Matthias Kuhn
4a7a8ff263 Update python code 2016-10-01 15:39:03 +02:00
Juergen E. Fischer
31df84aa6b run 2to3 on source 2016-09-21 23:30:04 +02:00
Alexander Bruy
acdde31b3d [processing] more cleanups (follow up 06c4b07222) 2016-08-05 15:05:36 +03:00
Nyall Dawson
c1649ebef4 [processing] pendingFields() -> fields()
Does the same thing, but pendingFields() is ugly
2016-08-05 06:31:07 +10: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
169d35f319 [processing] fix example script 2016-02-10 16:37:14 +02:00
Nyall Dawson
cbe8cb7282 Formatting update, using newer autopep8 version 2016-01-30 09:33:24 +11:00
Nyall Dawson
184db1aa28 Indentation fix 2016-01-14 08:57:04 +11:00
volaya
7a879994d4 [processing] fixed frequency analysis algorithm
code provided by Joseph Liam

fixes #14090
2016-01-13 09:55:30 +01:00
Juergen E. Fischer
b39055b39c indentation update (now including autopep8) 2015-08-22 14:29:41 +02:00
Spencer Gardner
94d3bdd01a fixed bad variable references 2015-08-15 22:17:35 -05:00
pcav
e25fb2de6d Fix for #12812 2015-05-22 19:57:40 +02:00
pcav
2004f22ac5 Uniform and informative output names for Processing (QGIS, final) 2015-05-22 16:39:20 +02:00
pcav
7dacddc08a Uniform and informative output names for Processing (QGIS, Take #1) 2015-05-22 15:56:45 +02:00
Alexander Bruy
d978f3fd9b [processing] fix Points along lines alg (fix #12768) 2015-05-20 11:51:32 +03:00
Alexander Bruy
426596c29f [processing] fix Number of unique values in classes alg (fix #12731) 2015-05-20 11:44:33 +03: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
Alexandre Neto
e26eae9496 Fixes Processing Keep n biggest parts bug #12001 2015-01-21 23:54:50 +00:00
Alexander Bruy
a81ec21564 [processing] remove help files already ported to User Guide 2015-01-20 09:45:54 +02:00
Giovanni Manghi
29f8b2399a fix a few qgis processing scripts 2015-01-09 19:02:50 +00:00
Juergen E. Fischer
8d3654baa7 indentation update 2014-10-20 00:16:36 +02:00
volaya
ac54c8e00a [processing] updated freq analysis alg 2014-10-03 10:42:03 +02:00
Juergen E. Fischer
907ce69306 indentation update 2014-08-17 09:24:22 +02:00
volaya
6486594f57 [Processing] Refactoring of parameters and outputs
It also adds some changes in the core and tools package, to provide a cleaner structure
2014-07-14 14:47:05 +02:00
Juergen E. Fischer
647504306c indentation update 2014-07-13 17:16:24 +02:00
Victor Olaya
f5b84ca101 [processing] fixed frequency algorithm 2014-07-12 10:39:50 +02:00
Larry Shaffer
cded8b180d [processing] Fix typo 2014-07-11 17:39:33 -06:00
Victor Olaya
e845e7896d [processing] added some new core algs as scripts 2014-07-11 09:06:34 +02:00