20647 Commits

Author SHA1 Message Date
Nyall Dawson
11a8d40a86 Allow geometries to be set separate to features in expression contexts
Refs #46455 -- we need a way to separate these too, as we don't always
want $geometry to refer to a feature's geometry
2022-02-21 13:04:07 +10:00
Nyall Dawson
118b3d32c1 Create QgsFieldDomainDialog dialog for configuring a field domain 2022-02-20 06:48:03 +10:00
Nyall Dawson
9c4bcf0092 Add widgets for creation of field domains 2022-02-20 06:48:03 +10:00
Nyall Dawson
c264eb50f5 Clarify removal 2022-02-20 06:48:03 +10:00
Nyall Dawson
3332b27edd QgsFieldItem is only equal when the QgsField is also equal
Otherwise the field item will not be updated when the gpkg parent
item is refreshed and the field definition has changed (e.g.
the field type)
2022-02-20 06:48:03 +10:00
Nyall Dawson
f8bbcab8bb Add flag for browser data item to indicate that children of the item
must be refreshed whenever the item is refreshed

This behaviour is not automatic. The new flag allows items to opt-in,
so that their children WILL be automatically refreshed when the
item is refreshed.

Should be used sparingly only to avoid expensive work
2022-02-20 06:48:03 +10:00
Nyall Dawson
063e059359 Add API to QgsAbstractDatabaseProviderConnection to create new field
domains on a database and set field domain associated with a field

And implement for OGR database provider connection class
2022-02-20 06:48:03 +10:00
Nyall Dawson
4a7fb87af5 [feature] Add browser properties page for field and fields items
In particular, this allows users to easily see what field domain
may be attached to particular fields
2022-02-20 06:48:03 +10:00
Nyall Dawson
e5a0d13ea4 Add domain name to QgsFieldConstraints 2022-02-20 06:48:03 +10:00
Nyall Dawson
a7b6b41fad Add docs 2022-02-20 06:48:03 +10:00
Nyall Dawson
8cd9b80149 Add browser properties widget for showing the properties of an existing
field domain
2022-02-20 06:48:03 +10:00
Nyall Dawson
1729ab1bc5 Add python file 2022-02-20 06:48:03 +10:00
Nyall Dawson
f482c85069 Show a "Field Domains" item for geopackages under the browser,
which lists existing field domains in the database
2022-02-20 06:48:03 +10:00
Nyall Dawson
8036ea89ed Add API to retrieve field domain names and definitions to QgsAbstractDatabaseProviderConnection
and implement for GPKG connections
2022-02-20 06:48:03 +10:00
Nyall Dawson
3d9a74176e More repr 2022-02-20 06:48:03 +10:00
Nyall Dawson
2be52d9df9 Create QgsFieldDomain and subclasses which directly represent
the GDAL field domain coded value/range/glob domains
2022-02-20 06:48:03 +10:00
Nyall Dawson
237152e5ff [feature][labeling] Allow data-defined control over line anchor type
Allows data-defined control over whether the 'hint' or 'strict'
anchoring type is used
2022-02-20 06:47:15 +10:00
Nyall Dawson
a578ecb33a Add QgsFields()['field_name'] getter for PyQGIS
A nice shorthand way to retrieve a field definition by name, instead
of having to determine the field index first.
2022-02-19 09:00:43 +10:00
Hannes
1877b3634a Show full traceback on Python expression function exception 2022-02-19 09:00:34 +10:00
Sandro Santilli
51da2ef551 Trust primary key of layers setup by DBManager TopoViewer plugin
Removes two very expensive queries per TopoViewer instance
Closes #47389
2022-02-16 16:35:37 +01:00
Nyall Dawson
ef85926a5d Correctly raise exceptions from XYZ tiles algorithm threads, and fix Python 3.10 compatibility 2022-02-14 16:20:55 +10:00
Alexander Bruy
e21ece09ba
Merge pull request #47205 from agiudiceandrea/fix-47200-gdal-rasterize-extent-optional
[processing] GDAL "Rasterize (vector to raster)" alg: make the 'EXTENT' parameter optional and transform it to the source layer CRS
2022-02-08 08:41:01 +02:00
Andrea Giudiceandrea
5f262509a5 GDAL Rasterize: additional test for extent CRS handling 2022-02-07 09:12:21 +01:00
Nyall Dawson
8f34557037 [processing] When closing a model with unsaved changes, if the user
accepts the prompt to save the changes BUT then cancels the file dialog
asking for the destination file name, don't treat this as though the
user has opted to discard the model
2022-02-07 12:01:07 +10:00
Nyall Dawson
d899da1ed2 [processing] Fix issues with edits to model outputs getting discarded
Specifically, this fixes two issues

1. If a user edits a dark green output block in a model and changes the
name of the output, that new name was always discarded and the only
way to change it was by editing the algorithm it was attached to

2. If an output was renamed through the algorithm properties dialog,
then any properties previously associated with that output (like
comments, coloring, placement, default value, mandatory flag)
would get reset back to their default settings
2022-02-07 10:04:00 +10:00
Andrea Giudiceandrea
ad8237713a GDAL Rasterize: add test for extent CRS handling 2022-02-06 16:51:10 +01:00
Andrea Giudiceandrea
78d764e42a GDAL Rasterize: check earlier for parameter validity 2022-02-06 10:01:00 +01:00
Andrea Giudiceandrea
8e4a6d6e8b [processing] GDAL Rasterize: add extent CRS conversion 2022-02-05 12:49:31 +01:00
Andrea Giudiceandrea
98d5eb686e
[processing] GDAL Rasterize: make extent parameter optional
The corresponding -te parameter in gdal_rasterize is optional (if not specified, it defaults to the extent of the input vector layer)
2022-02-05 11:39:59 +01:00
Nyall Dawson
91ca892c34 Fix translation string 2022-02-05 11:05:51 +10:00
Nyall Dawson
b5d2ebd696 Fix build 2022-02-05 11:05:51 +10:00
Nyall Dawson
7b9b486096 [processing] When "saving as" a model, if the model name originally
was a complete match for the old file name, then update the model
name for the saved as model to also match the NEW file name

E.g.

Scenario 1
- user has a model stored as "Save features.model3", named "Save
  features"
- user 'saves as' this model as "Delete features.model3"
- the model name is automatically updated to match the new file
name, i.e. "Delete features"

Scenario 2
- user has a model stored as "Save features.model3", named "Process
incoming features from API"
- user 'saves as' this model as "Save features v2.model3"
- the model name is NOT changed, and is left at the original
"Process incoming features from API" name
2022-02-05 11:05:51 +10:00
Nyall Dawson
29a59e70bf Add method to test whether model file name matches model name 2022-02-05 11:05:51 +10:00
Nyall Dawson
a169055277 [processing] Improve UX when saving models
- When saving a model to a file, don't require that the model already
has a name entered. Instead, if no model name has been entered then
set the model name automatically to match the selected save filename.
E.g. if the user saves the model as "Process incoming features.model3",
then the model name will be set to "Process incoming features".
- When first saving a model, IF the user HAS already entered a model
name then make the default file name suggested by the dialog match
this model name
2022-02-05 11:05:51 +10:00
Nyall Dawson
91cf8954f4 [processing] Default to "Model Input" sources for map layer parameters
when configuring a new algorithm

While the previous behaviour of defaulting to a static value makes
sense for things like numeric parameters, this is a very rare use
case for map layer parameters. For better new user experience we can
default instead to showing model inputs for these parameter types.
2022-02-04 18:14:22 +10:00
Nyall Dawson
e748877a59 [processing] Fix initial directory shown in model open file dialogs
should be the users home file, or the last used model directory
2022-02-04 16:34:53 +10:00
Nyall Dawson
8486afbdd1 [processing] Fix model designer sometimes opens behind other windows 2022-02-04 16:34:53 +10:00
Paul Blottiere
71046f80f9
Merge pull request #47029 from pblottiere/wfs_filters_mapping
Fixes WFS EXP_FILTER parsing in GetFeature request
2022-02-03 12:02:20 +01:00
Andrea Giudiceandrea
ed9bb49ff1 Add 'Stepped Line' and 'Hollow' styles to QgsLayoutItemScaleBar::setStyle() docs 2022-02-03 20:51:53 +10:00
Alexander Bruy
a5baaf3ef8 [processing] reword error messages about missing GRASS (fix #46052) 2022-02-03 20:51:34 +10:00
Nyall Dawson
e46875b9b6 QgsDistanceArea::bearing can raise QgsCsExceptions, so ensure that
these are always gracefully caught

Avoids some unwanted "unhandled exception" message boxes which
can pop up while moving the mouse around outside of the valid bounds
of the current map projection
2022-02-03 06:19:50 +10:00
Juergen E. Fischer
ac7638238d detect grass 8 in processing provider 2022-02-02 17:58:07 +01:00
Blottiere Paul
602391eea1 Add doc and update binding 2022-02-02 16:51:42 +01:00
Blottiere Paul
9bdbe12f8c Binding 2022-02-02 16:51:42 +01:00
Ismail Sunni
42df6455eb Fix #46538, fix misleading warning when uninstalling experimental plugin. 2022-02-02 08:36:52 +10:00
Nyall Dawson
01f0130ffb Remove unused qgsCalloc function 2022-02-02 07:44:13 +10:00
Nyall Dawson
a622004e21 [processing] Fix python exception raised after running in-place
algorithm which requires no parameters
2022-02-02 05:41:45 +10:00
NEDJIMAbelgacem
e5f625f8c9 extend attribute datatypes to include the ones used for extrabytes 2022-02-01 06:04:12 -08:00
Nyall Dawson
65287ee4f7 In saga/grass/otb processing plugin tests, only load the provider
being tested instead of every provider
2022-02-01 18:14:48 +10:00
Nyall Dawson
dd368a4289 When processing is initialized in external scripts, ensure the GRASS,
SAGA and OTB providers are included by default

Fixes #45935
2022-02-01 18:14:48 +10:00