85956 Commits

Author SHA1 Message Date
Nyall Dawson
6785fe4554 [cmake] Use execute_process instead of deprecated EXEC_COMMAND
See CMP0153
2024-04-21 12:52:02 +10:00
Andrea Giudiceandrea
2121644904 [DB Manager] Avoid printing HTML code in the Python console 2024-04-21 12:13:14 +10:00
Mathieu Pellerin
b9898d0fa1
Merge pull request #57166 from nirvn/fields_gadget
[qml] Make QgsFields a QGadet and make some functions Q_INVOKABLE
2024-04-21 05:53:41 +07:00
Nyall Dawson
a979931960 Function naming improvements 2024-04-21 06:46:35 +10:00
Nyall Dawson
0a877ea4af Documentation improvements 2024-04-21 06:46:35 +10:00
Nyall Dawson
ae766b0d69 Trim first child log 2024-04-21 06:46:35 +10:00
Nyall Dawson
de0f5cf87c Make API more future proof 2024-04-21 06:46:35 +10:00
Nyall Dawson
75455dffad Move class to own file 2024-04-21 06:46:35 +10:00
Nyall Dawson
e2d6b54f35 Add "View Log" action for child algorithms
This action shows the log of that child step, regardless of whether
or not it failed. This is handy for debugging model errors after
testing, when you've already closed the algorithm window...!
2024-04-21 06:46:35 +10:00
Nyall Dawson
d4369f714d Make log of each separate child algorithm available for retrieval after
running model
2024-04-21 06:46:35 +10:00
Nyall Dawson
172a1c2b03 Make execution status available for child algorithms 2024-04-21 06:46:35 +10:00
Nyall Dawson
8302259463 Make child results handling API more flexible 2024-04-21 06:46:35 +10:00
Nyall Dawson
833f02b09b Fix warning 2024-04-21 06:46:35 +10:00
Nyall Dawson
6c22cd0355 [feature] Add "View Output Layers" option for model child algorithms
When editing a model through the designer (and after having run
that model), you can now right click any child step in the model
and select "View Output Layers". This will add the output layers
from that step as new layers in the current QGIS project.

This action is available for ALL child algorithms in the model,
even if the model is not configured to use the outputs from those
children as model outputs.

This is designed as a helpful debugging action. If a user's model
fails (or gives unexpected results), they can then trace through
the model and view the outputs for suspected problematic steps.
It avoids the need to add temporary outputs to a model and re-run
to test.

Additionally, this action is always available after running the model,
EVEN if the model itself failed (eg because of a misconfigured
step later in the model).

Sponsored by City of Canning
2024-04-21 06:46:35 +10:00
Nyall Dawson
5ebbb3da46 Make child results and inputs always available for models
Even when the model execution fails, store the child inputs and
results for all steps which successfully completed in the context.

This gives more debugging information to a user when a model fails,
because these values will now be reflected in the model designer
view for all steps which completed.
2024-04-21 06:46:35 +10:00
Nyall Dawson
3deec36065 Transfer temporary results to a layer store in the designer dialog
After running a model through the designer dialog, any layers generated
during the execution of the model will now be transferred into a layer
store attached to the dialog, instead of immediately discarded. This
includes layers generated by child algorithms as intermediate steps
and not just model outputs.

By moving the lifetime of the generated layers to the designer dialog,
we are able to do things with these layers after the run algorithm
dialog is closed. (Eg allowing users to load them to a project)

The designer's layer store is cleared on each run of the model.
2024-04-21 06:46:35 +10:00
Nyall Dawson
133bad76ee Move some model designer code to c++ 2024-04-21 06:46:35 +10:00
Nyall Dawson
7f4fe65bee Ensure that QgsProcessingAlgorithm::postProcess is always called
We now always call QgsProcessingAlgorithm::postProcess, even when
the algorithm fails for some reason (eg it raises an exception).
This ensures that the context cleanup logic in postProcess is
always run. Note that we still ONLY call an algorithm's specific
postProcessAlgorithm implementation for successful executions,
so the public facing API and behavior remains unchanged.

This is intented to provide a consistent handling of the cleanup
logic in postProcess, specifically to make sure that that the
context thread handling logic is triggered in all cases.
2024-04-21 06:46:35 +10:00
Nyall Dawson
9d6faf3d00 Prevent changing ID if layer is owned 2024-04-20 16:50:56 +10:00
Nyall Dawson
031b2c755d Emit idChanged on readLayerXml if id is changed 2024-04-20 16:50:56 +10:00
Nyall Dawson
d750c9d89c Fix test 2024-04-20 16:50:56 +10:00
Nyall Dawson
ed2d4f559b Add idChanged signal, property 2024-04-20 16:50:56 +10:00
Nyall Dawson
19585bf1fd Add api to set QgsMapLayer IDs
With appropriate warnings on when this should be used...
2024-04-20 16:50:56 +10:00
Nyall Dawson
1f447c6e04 [processing] Show marker on canvas at picked point location
When an algorithm has a point parameter and is run from the toolbox,
show a X rubber band marker at the picked point on the map canvas

This makes it easier to see where the point parameter is set to.

The marker is cleared as soon as the algorithm dialog is closed.
2024-04-20 08:50:18 +10:00
Nyall Dawson
7355c24db8 [processing] Endpoint distance threshold for network analysis
Adds an optional end point distance threshold parameter to the
network analysis tools. Previously (and still, by default) endpoints
will ALWAYS be snapped to the nearest point in the network layer,
regardless of how far away from the network they actually are. This
can result in meaningless results, as the tools will happily snap
points to a road hundreds of kilometers away :)

Now, there's an optional end point distance threshold parameter
for these tools. The behaviour of the threshold depends on the
algorithm:

- For the “Service area (from layer)” tool an optional new output
was added for “non routable features”. This output will contain
any features which were deemed too far from the network. All
other features which are within tolerance distance to the
network will be stored in the standard output from the tool.
- For the “Service area (from point)” tool an error will be raised
if the point is too far from the network
- For the “Shortest path (point to point)” tool an error will
be raised if either the source or destination points are too far
from the network.
- For the “Shortest path (layer to point)” and “Shortest path (point
to layer)” tools:
  - An error will be raised if the **point** is too far from the network.
  - A new optional output was added for “non routable features”. This
    output will contain any features which were deemed too far from the
    network. All other features which are within tolerance distance to
    the network will be stored in the standard output from the tool.

Sponsored by City of Canning
2024-04-20 08:50:00 +10:00
Nyall Dawson
fc1922ae43 [processing] When no specific layer group is required for an output,
place it above the current selected layer

Fixes #56129
2024-04-20 08:49:45 +10:00
Nyall Dawson
51378f9827 [processing] Set the active layer to one of the generated outputs
Fixes #57003
2024-04-20 08:49:45 +10:00
Andrea Giudiceandrea
a9fee347eb [spatialite] Test getQueryGeometryDetails for geom with Z, M or ZM 2024-04-19 18:11:48 +02:00
Andrea Giudiceandrea
531afc3935 [SpatiaLite] Fix getQueryGeometryDetails() for Z, M and ZM 2024-04-19 18:11:48 +02:00
Mathieu Pellerin
d9677bcb1c
Merge pull request #57016 from gacarrillor/dxf_overridden_name
[dxf] Allow users to override the layer name to be exported to DXF
2024-04-19 20:44:09 +07:00
Harrissou Sant-anna
220abf7aa9 Fix casting of symbol layer densityArea property 2024-04-19 07:08:34 +10:00
Nyall Dawson
fbad0b4e28 Fix test on newer GDAL versions 2024-04-18 13:25:16 +10:00
Nyall Dawson
d95ac4a7ea Better reporting for invalid field names for some algorithms 2024-04-18 13:25:06 +10:00
Nyall Dawson
5b912fab9d Escape filenames correctly 2024-04-18 11:32:28 +10:00
Nyall Dawson
c033ac8ccd Show filename in exceptions raised from Python console scripts
Instead of "", ensure the actual filename (or tab title, for unsaved
scripts) is shown in exceptions
2024-04-18 11:32:28 +10:00
Nyall Dawson
3688035942 Ensure filename is shown when an exception occurs in a dropped Py script 2024-04-18 11:32:28 +10:00
Nyall Dawson
3ac4fd4ca8 Ensure __file__ is set when running python scripts dropped onto QGIS 2024-04-18 11:32:28 +10:00
Nyall Dawson
5e85f29512 Add Google Fonts processing script 2024-04-18 11:31:55 +10:00
Nyall Dawson
b70fba6762 Download Google fonts from github, not broken Google fonts download url
Note that not all fonts available from Google fonts are present on
the github repo for some reason, eg Open Sans Condensed is not.

Fixes #57070
2024-04-18 11:31:55 +10:00
Mathieu Pellerin
62c5427f58
Merge pull request #57161 from nirvn/qml_invokable_additions
[qml] Add a couple of Q_INVOKABLE in QgsProject and QgsVectorLayer to ease layer and feature fetching + editing
2024-04-17 23:25:31 +07:00
Alessandro Pasotti
dd0412da89
Merge pull request #57046 from elpaso/bugfix-server-oapif-layerpermissions
Server/OAPIF: fix unreported issue with access control layer permissions
2024-04-17 15:33:31 +02:00
Alessandro Pasotti
f9688deeef Server/OAPIF: fix unreported issue with access control layer permissions
When 'canRead' property for a published WFS layer was set to False
from an access control filter plugin the whole /collections reques
was returning a 404 insted of returning the list of published layers
(minus the filtered ones).
2024-04-17 14:06:30 +02:00
Mathieu Pellerin
37af25e0b6 Move some invokables to properties 2024-04-17 18:27:33 +07:00
Mathieu Pellerin
fbd4af04ef [qml] Allow for getting/setting attribute by index and name 2024-04-17 18:07:43 +07:00
Mathieu Pellerin
6709debbac Fix sipify.pl script not handling Q_INVOKABLE inline 2024-04-17 18:07:43 +07:00
Mathieu Pellerin
70ceb9d317 [qml] Expose map layers by name project function 2024-04-17 18:07:43 +07:00
Mathieu Pellerin
6f1f5d2ef6 [qml] Make a couple of vector layer editing/deletion functions invokable 2024-04-17 18:07:43 +07:00
Mathieu Pellerin
5d796e9dfa [qml] Make QgsFields a QGadet and make some functions invokable 2024-04-17 11:15:23 +07:00
Germán Carrillo
82fb6ccd24 [dxf] Address review: prefer overridden layer name over layer title (the former can be changed in the export dialog, whereas the latter must be done in the layer properties, therefore, overridden layer name is closer to the export intention and should take the precedence) 2024-04-16 17:54:46 +02:00
Germán Carrillo
c2e248befc [dxf] Allow users to recover original layer name after overriding it (by using the QgsFilterLineEdit with default value) 2024-04-16 11:33:49 +02:00