6608 Commits

Author SHA1 Message Date
Nyall Dawson
3e1c84e07e Finalize sinks to get proper error reporting when flushing features
Fixes #59237
2024-11-12 08:49:18 +01:00
Nyall Dawson
1a4bd44937 Rename field to extremum_type 2024-11-11 13:01:42 +10:00
Nyall Dawson
2890df089d [feature] Add raster zonal min/max algorithm
This algorithm extracts point features corresponding to the minimum
and maximum pixel values contained within polygon zones.

The output will contain one point feature for the minimum and one
for the maximum raster value for every individual zonal feature
from a polygon layer.
2024-11-11 13:01:42 +10:00
Nyall Dawson
a7bd4f3bf2 [processing] Add algorithm to extract min/max pixel from raster
This algorithm extracts extrema (minimum and maximum) values
from a given band of the raster layer.

The output is a vector layer containing point features for
the selected extrema, at the center of the associated pixel.

If multiple pixels in the raster share the minimum or maximum
value, then only one of these pixels will be included in the output.

The algorithm uses raster iterator to remain efficient on huge
rasters, and does not require reading the entire raster to
memory
2024-11-07 10:13:55 +11:00
signedav
774c5a913c Fix passing missing context to expression of select by expression algorithm 2024-11-01 11:44:44 +10:00
mazano
6ca60b7502
[ogr2ogr] Fix promote to multipart logic and add makevalid option (#58440) 2024-10-18 07:45:43 +10:00
Nyall Dawson
2c34056199 pyqt5_to_pyqt6.py run 2024-10-17 17:58:49 +10:00
Nyall Dawson
578aa207d0 Show warning when loading batch params for algs with security risk
If the algorithm has the security risk flag, warn the user before
they can open stored batch parameter files
2024-10-02 10:36:00 +10:00
Nyall Dawson
2fdb2cad80 Add processing algorithm flag for SecurityRisk
And add to "Advanced Python field calculator" algorithm, as that
algorithm uses the Python exec() function and is a security
risk if run with untrusted/unchecked inputs
2024-10-02 10:36:00 +10:00
Nyall Dawson
0d55518c24 [processing] Fix translation of elapsed strings
Fixes #58635
2024-10-01 20:30:39 +10:00
Nyall Dawson
6c1de7f70a [processing] Replace format for saving batch processing parameters
The older approach of storing parameters was insecure, and required
eval()ing the unchecked contents of the batch parameter file. This
is a security risk, as a malicious file could leak user information
or damage the system.

So,

- Switch to a newer ".batch" format which uses safe JSON objects
only for serializing parameter values.
- Allow loading the older .json files, but first show a warning
that they are a security risk and require to user to explicitly
agree to open the file
2024-10-01 19:35:51 +10:00
Nyall Dawson
95c9bb56b2 Remove unused code 2024-10-01 19:35:51 +10:00
Florian Neukirchen
dd4f71c1f3 Fix indentation 2024-10-01 08:36:59 +10:00
Florian Neukirchen
b8ca25da95 value field must be numeric 2024-10-01 08:36:59 +10:00
Florian Neukirchen
1fd614b0ef Fix AttributeError: module 'plotly.graph_objs' has no attribute 'Area': it is go.Barplot in recent plotly versions 2024-10-01 08:36:59 +10:00
Andrea Giudiceandrea
e688fb104e [gui][pocessing][modeler] Fix window's title 2024-09-24 06:40:50 +10:00
Andrea Giudiceandrea
016a33f43f [processing] Fix warning in postprocessing 2024-09-16 09:31:55 +10:00
Andrea Giudiceandrea
ab611a9a19 [pocessing] QVariant->QMetaType in "Select by attribute"
QgsField.type() returns QMetaType.Type
2024-09-16 08:48:01 +10:00
Andrea Giudiceandrea
81fb58f997 [processing] Fix deprecated QgsField constructor
Using QMetaType.Type in place of QVariant types for:
- "Check validity" qgis:checkvalidity
- "Climb along line" qgis:climbalongline
- "Add geometry attributes" qgis:exportaddgeometrycolumns
- "Advanced Python field calculator" qgis:advancedpythonfieldcalculator
- "Find projection" qgis:findprojection
- "Distance to nearest hub (line to hub)" qgis:distancetonearesthublinetohub
- "Distance to nearest hub (points)"  qgis:distancetonearesthubpoints
- "Concave hull (k-nearest neighbor)" qgis:knearestconcavehull
- "Minimum bounding geometry" qgis:minimumboundinggeometry
- "Distance matrix" qgis:distancematrix
- "Generate points (pixel centroids) along line" qgis:generatepointspixelcentroidsalongline
- "Random points along line" qgis:randompointsalongline
- "Random points in layer bounds" qgis:randompointsinlayerbounds
- "Random points inside polygons" qgis:randompointsinsidepolygons
- "Regular points" qgis:regularpoints
- "Statistics by categories" qgis:statisticsbycategories
- "Text to float" qgis:texttofloat
- "Topological coloring" qgis:topologicalcoloring
2024-09-16 08:48:01 +10:00
Harrissou Sant-anna
bb275d1188
Modeler - Show group in the algorithm dialog title 2024-08-27 18:41:52 +02:00
Nyall Dawson
626df694fa Avoid multiple doc strings copies, add comments 2024-08-17 19:59:17 +10:00
Nyall Dawson
532129abf7 Improve processing monkey patching
"forward declare" functions which will be patched when the processing
plugin starts, so that these are known and accessible during the PyQGIS
doc building. Also make these forward declared versions raise
QgsNotSupportedException, so that its clear why they aren't working
when the processing plugin hasn't started

Fixes https://github.com/qgis/pyqgis-api-docs-builder/issues/38
2024-08-17 19:59:17 +10:00
Mathieu Pellerin
26b7c1ed7d [processing] Fix script editor dialog flagging opened files as immediately modified 2024-08-16 15:05:37 +07:00
Mathieu Pellerin
26308050c4 [processing] Fix script editor dialog wrongly jumping back to line 1 and setting changed to true after saving file 2024-08-16 14:53:53 +07:00
Nyall Dawson
7c0c56b96b Add flag to a few more algorithms 2024-07-15 14:33:21 +10:00
Andrea Giudiceandrea
5f85a82caa [processing][feature] Add tests for gdal:ogrinfo and gdal:ogrinfojson 2024-07-11 08:58:22 +10:00
Andrea Giudiceandrea
3d8a7a7a80 [processing][feature] Enhance gdal:ogrinfo - Add gdal:ogrinfojson 2024-07-11 08:58:22 +10:00
uclaros
22895e6b6f Allow postgresraster layers as gdal processing tools input 2024-07-11 08:37:02 +10:00
Nyall Dawson
4c2983189f
When an OGR algorithm is run on a GRASS provider vector layer,
export the layer to an OGR compatible source first

Use the same logic we use eg for auto-exporting memory layers
so that GDAL tools "just work" with GRASS provider vector
layers
2024-07-09 09:53:52 +10:00
Alexander Bruy
5e53e183a5 address review comments 2024-07-05 05:18:25 +10:00
Alexander Bruy
7bd8c071f3 port Basic statistics for fields algorithm to C++
Also add new optional output a table containing calculated statistics
similar to the Statistics by categories algorithm (fix #46241)
2024-07-05 05:18:25 +10:00
Alexander Bruy
f0db0f247b address review 2024-07-04 07:30:51 +10:00
Alexander Bruy
40f85dd8e7 allow user to add/remove Processing algorithms to/from Favorites 2024-07-04 07:30:51 +10:00
Nyall Dawson
7ec94dc2c3 Only run gdal_grid, gdal_rasterize tests on GDAL 3.7+
The inputs we use for these run tests have open options, and now
that we are respecting these and passing them to the GDAL command
we can't run these tests on the earlier GDAL versions which
didn't support open options.

The commands generated by the corresponding algorithms are already
well tested and still run on the earlier GDAL releases, it's just
the actual run test which will be skipped.
2024-06-27 13:07:25 +10:00
Nyall Dawson
2d27784cee Raise exceptions if open options not supported by GDAL version 2024-06-27 13:07:25 +10:00
Nyall Dawson
c0ad63cf36 Regenerate some GDAL output reference files
We now pass on the FORCE_SRS_DETECTION=YES open option which we
were previously dropping, so the results for these commands is
slightly different

Also drop test for older GEOS versions, it's covered by a test
for more recent versions and we have extensive test covering
the GDAL command line for this tool anyway.
2024-06-27 13:07:25 +10:00
Nyall Dawson
e38849d750 Fix running GDAL algorithms on cloud storage layers
Correctly generate commands when run on eg /vsis3/ layer sources,
and translate credential options to "--config KEY VALUE" arguments
for GDAL commands
2024-06-27 13:07:25 +10:00
Nyall Dawson
2ab2d34947 Correctly handle open options for raster GDAL algorithm inputs
And handoff to GDAL command when command supports them
2024-06-27 13:07:25 +10:00
Nyall Dawson
18efe655e9 Pass vector layer open options over to GDAL command
Ensures that processing tools which use vector layers with open
options work correctly, respecting the layer's open option settings
2024-06-27 13:07:25 +10:00
Nyall Dawson
36e3c43f84 Make getOgrCompatibleSource API more flexible 2024-06-27 13:07:25 +10:00
Nyall Dawson
46a4241ace minor cleanup 2024-06-27 13:07:25 +10:00
Nyall Dawson
dcacebaeaa Cleanup API for GDAL processing provider uri conversion 2024-06-27 13:07:25 +10:00
Alexander Bruy
ad126316d3 use core raster options widget in GDAL algorithms 2024-06-26 21:50:27 +10:00
Nyall Dawson
b1947bfa8a Fix console script editor tries to save as ".py.py" 2024-06-18 05:23:57 +10:00
Nyall Dawson
d345c68c5a Move responsibility for loading scripts to QgsCodeEditorWidget 2024-06-18 05:23:57 +10:00
Nyall Dawson
5ea8a0df25 Fix tests on newer GEOS 2024-06-17 13:23:27 +10:00
Loïc Bartoletti
015e06575c [Processing] creategrid: Allow negative overlay
The creategrid algorithm had a limit of 0 to 1000000000.0.
I'm removing this limitation to go beyond this maximum limit, but above all to
allow a negative limit, which in fact allows an empty space
(the opposite of superposition).
2024-06-07 23:27:55 +02:00
Nyall Dawson
c685a9aa77 Replace processing default extension setting with string based setting
Change the setting key to force a reset for all users, and move to
a stable string based setting instead of a fragile int index key

Fixes #57676
2024-06-07 18:44:57 +10:00
Nyall Dawson
4986525e6b Ensure calling isSupportedOutputValue doesn't add layer to project
This is an advance test only, and shouldn't result in layers
attempting to add to the project.

Refs #57698
2024-06-07 18:44:29 +10:00
Julien Cabieces
48e2043505 fix new deprecated iconForField and typeToDisplayString methods 2024-05-31 08:46:33 +10:00