323 Commits

Author SHA1 Message Date
David Marteau
467dd26de0
Fix 'mkdir' in python processing tools 2021-04-28 11:26:39 +02:00
Denis Rouzaud
eddf6feb45 modernize CMakeLists.txt files 2020-11-12 07:14:46 +10:00
Vincent Cloarec
1fbba79a0f
Mesh export processes, first part : infrastructure and export vertices (#39664)
[processing] Infrastructure for QgsMeshLayer to add processing algorithms, dataset group paramater and dataset time parameter to allow the user to easily choose a dataset.
2020-11-03 06:05:28 +01:00
Etienne Trimaille
6076950c68 Add help string for parameters in Processing 2020-09-21 11:05:34 +10:00
Nyall Dawson
4edc7d11d9 Drop postgis GeoDB class from Processing
This class is unused and is a near 1:1 copy of the core connections API
+ db manager classes
2020-03-17 15:10:53 +10:00
Nyall Dawson
3c3efe5f7a Remove unused spatialite python connection class 2020-03-17 15:10:53 +10:00
Nyall Dawson
3b8565115a Also lazy load numpy 2019-11-17 17:08:12 +10:00
Alessandro Pasotti
6c9f01e28d Fix postgis 12 adscr -> adbin consrc -> conbin 2019-11-06 12:53:52 +01:00
Juergen E. Fischer
b81d306047 spelling fixes (closes #32408) 2019-10-26 10:50:30 +10:00
Nyall Dawson
3112332227 Rename variable for clarity 2019-10-09 15:01:51 +10:00
Nyall Dawson
cb06519d16 [api] Add API to indicate that individual layers may be loaded without any
CRS validation, regardless of the user's settings

This avoids hacks put in place in other parts of QGIS code or in plugins
to temporarily deactivate the CRS validation prompt, providing a supported,
stable method to indicate that when loading a particular layer no CRS
validation is required.
2019-10-09 15:01:51 +10:00
Paul Wittle
be25b2e392 Update general.py
Correction of error return type from bool to None (as per comments). This is to resolve unexpected exception messages when algorithm is not found.
2019-09-20 09:27:30 +01:00
Alessandro Pasotti
fd4895b9fb processing postgis connector quote indexes names 2019-05-22 18:28:35 +02:00
Alessandro Pasotti
ad24b87601 Add missing error class and quote identifiers
Fixes #22035 - case sensitive schema
2019-05-22 18:15:19 +02:00
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
234c1718c4 Mark some Processing methods as deprecated 2019-03-28 11:47:23 +10:00
Nyall Dawson
f758d8b282 Ensure all public, stable API methods for Processing have nice docstrings 2019-03-28 11:47:23 +10:00
Nyall Dawson
7f7c7a9789 [processing][needs-docs] Add friendlier API for running algorithms as sub-steps
of main algorithm

Using code like:

    buffered_layer = processing.run(..., context, feedback)['OUTPUT']
    ...
    return {'OUTPUT': buffered_layer}

can cause issues if done as a sub-step of a larger processing algorithm. This
is because ownership of the generated layer is transferred to the caller
(Python) by processing.run. When the algorithm returns, Processing
attempts to move ownership of the layer from the context to the caller,
resulting in a crash.

(This is by design, because processing.run has been optimised for the
most common use case, which is one-off execution of algorithms as part
of a script, not as part of another processing algorithm. Accordingly
by design it returns layers and ownership to the caller, making things
easier for callers as they do not then have to resolve the layer reference
from the context object and handle ownership themselves)

This commit adds a new "is_child_algorithm" argument to processing.run.
For algorithms which are executed as sub-steps of a larger algorithm
is_child_algorithm should be set to True to avoid any ownership issues
with layers. E.g.

    buffered_layer = processing.run(..., context, feedback, is_child_algorithm=True)['OUTPUT']
    ...
    return {'OUTPUT': buffered_layer}
2019-01-29 18:04:16 +11:00
Víctor Olaya
1b4a9132c2 [processing] avoid exception when listing DB schemas
do not fail if cert file cannot be deleted when creating GeoDB object

fixes #21099
2019-01-29 08:01:20 +11:00
Juergen E. Fischer
196024ccba typo fixes 2019-01-01 21:53:37 +01:00
Nyall Dawson
0e928e8191 [processing] Correctly set parent widgets for algorithm dialogs
to avoid dialogs immediately going out of scope and being garbage
collected
2018-11-23 20:32:16 +11:00
Nyall Dawson
85efc77bb4 Fix inefficient calls to QgsFeature.attributes()[idx]
Replace with just f[idx]. Calling QgsFeature.attributes()
allocates a list of all attributes, which is inefficient
when only a single attribute value is needed.
2018-10-31 08:42:51 +10:00
Nyall Dawson
6e06c32a10 [processing] Fix crash when an algorithm dialog is left open and
processing options are changed

Make sure the algorithm dialogs use their own copy of algorithms,
instead of the copies owned by the processing registry. Opening
processing options triggers a full reload of providers, deleting
all existing algorithm instances from the registry first.
2018-09-25 10:32:20 +10:00
Nyall Dawson
16ac437780 [processing] Fix bar and box plot exception when category field has NULL values 2018-06-20 08:07:23 +10:00
Nyall Dawson
cbbe905fae [processing] Fix missing schemas in postgis destination selection panel 2018-06-06 06:27:03 +10:00
Tom Chadwin
fab563fe71 Processing: avoid deprecated regex
Invalid escape sequence avoided via raw string:

`re.findall("\d+|[a-zA-Z]+", rep[0][0])` > `re.findall(r"\d+|[a-zA-Z]+", rep[0][0])`
2018-06-06 06:24:24 +10:00
Nyall Dawson
612d61dc09 [processing] Tweak algorithHelp formatting 2018-05-31 15:27:34 +10:00
Nyall Dawson
db916bc238 [processing] Show accepted data types for parameters in processing.algorithmHelp 2018-05-31 15:27:34 +10:00
Nyall Dawson
0d21bd0429 [processing] Include description in algorithmHelp output 2018-05-17 08:50:39 +10:00
Nyall Dawson
f4599f13f1 [processing][gdal] Better error messages when invalid parameters are passed 2018-05-06 19:19:45 +10:00
gacarrillor
f07cd2f5b9 [processing] Add comment to make it clear why we need to close the dialog here 2018-05-02 23:46:42 -05:00
gacarrillor
387e724b0f [processing] Refactor Fields algorithm: avoid unnecessary confirmation dialogs 2018-04-30 11:14:36 -05:00
Alexander Bruy
23a5dd3197 [processing] fix file permissions 2018-02-06 19:25:48 +02:00
Nyall Dawson
b8defc113c When processing tasks are clicked in task manager, reopen the
algorithm dialog
2018-01-16 19:45:40 +10:00
Nyall Dawson
5f7aa45aab [needs-docs][processing] Add methods to show algorithm dialog
Adds processing.createAlgorithmDialog and
processing.execAlgorithmDialog. These methods can be used
to create and execute algorithm dialogs for a specified algorithm,
optionally pre-populated with a given set of (non-default) parameter
values.
2017-12-21 11:01:49 +10:00
Alexander Bruy
79d83f2066 [processing] use core methods for raster and vector extensions handling 2017-12-11 09:38:14 +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
ee8435a789 [processing] remove unused 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
Nyall Dawson
a95aecafd6 Fix tests 2017-11-26 16:28:59 +10:00
Matthias Kuhn
06bae21d51
Merge pull request #5579 from DelazJ/logmessages
Clarify where and what Log Messages is
2017-11-20 15:54:29 +01:00
Harrissou Sant-anna
9481067f4d
Fix indentation 2017-11-20 12:07:12 +01:00
Harrissou Sant-anna
f699e35ce9 Add more translatable strings 2017-11-18 18:51:39 +01:00
Médéric RIBREUX
d10aaf4bd4 Support multiple output file raster formats:
* A new createopt textbox has been added to the parameters dialog for algorithms which exports to raster files.
* A new metaopt textbox has also been added to the Algorithm parameters dialog.
* Raster file format is detected from output filename extension.
* GdalUtils has been improved to correctly detect raster formats supported for creation.
* QFileDialog for output rasters now display only file filters for supported output raster file formats.
2017-11-05 13:18:24 +01:00
Juergen E. Fischer
f243b8448e postgres: add support for partitioned tables (implements #17302) 2017-10-21 17:39:18 +02:00
Matthias Kuhn
23c7517dc9 Migrate processing help to new processing registry 2017-10-16 23:34:34 +02:00
Matthias Kuhn
60db6b0665 Fix member access in postgis.py 2017-10-16 23:34:19 +02:00
Nyall Dawson
0dd434c183 [processing] Port mean coordinates to c++
And remove final use of inefficient vector.extractPoints function
2017-09-23 09:25:18 +10:00
Nyall Dawson
10d6ef06e8 Replace more duplicate code with QgsProcessingUtils.combineFields 2017-09-23 08:41:54 +10:00
Nyall Dawson
a191c77bcb Remove duplicate testForUniqueness method (replaced with QgsProcessingUtils.combineFields) 2017-09-23 08:37:35 +10:00