21231 Commits

Author SHA1 Message Date
Nyall Dawson
e1dba0dbe0 Allow for multiple user font directories, and add method to return
all installed user fonts
2022-06-20 13:01:55 +10:00
Nyall Dawson
852480c7bc Wrap up font download in a nice method which just requires a family name
And populate hardcoded list with a bunch of known fonts available
from Google Fonts
2022-06-20 13:01:55 +10:00
Nyall Dawson
4772f6c27e Add method to download and install a font 2022-06-20 13:01:55 +10:00
Nyall Dawson
0f4f5cd2cc Description for QgsNetworkContentFetcherTask can be customised 2022-06-20 13:01:55 +10:00
Nyall Dawson
4f2705e435 Make any TTF/OTF fonts stored in the QGIS user profile/fonts directory
available for use in QGIS

Allows for use of fonts which aren't installed system-wide in QGIS, e.g.
when the user does not have permission to install fonts on a system.
2022-06-20 13:01:55 +10:00
Nyall Dawson
d4ef3e3c3d Make sure QgsFontManager methods are thread safe 2022-06-20 13:01:55 +10:00
Nyall Dawson
607b140c30 Add method to process a font family name and apply any matching
replacements
2022-06-20 13:01:55 +10:00
Nyall Dawson
602edc11d9 Attach font manager to QgsApplication 2022-06-20 13:01:55 +10:00
Nyall Dawson
3d7310b65c Persist font replacements across sessions 2022-06-20 13:01:55 +10:00
Nyall Dawson
0091696272 Start on QgsFontManager class 2022-06-20 13:01:55 +10:00
Nyall Dawson
dbdacac777 [feature] Add temporal manager support for WMTS layers with TIME dimension
This enhancement exposes any WMTS "time" dimensions for use in the
temporal framework, including allowing these layers to be animated
and controlled via the temporal controller.

There's some complexity involved here, because the WMTS specification
does NOT dictate how a time dimension should be exposed by services.
So different WMTS services are all handling this in different ways,
and we need to try to be as tolerant as possible.

Specifically, WMTS dimension values are just free-form strings, so
I've encountered a range of datetime formats -- e.g. "2021", "20210203",
"2021-02-03", "2021-02-03T12:13:14Z", and even WMS(T) style time
period designations ("2021-01-03T12:13:14/2021-01-05T12:15:11/P10M")!
These different formats all need special handling in order to correctly
interpret them as a date time value, and to be able to re-encode
an arbitrary datetime value back to the format string required
by the service. It's highly likely that we'll encounter additional
format strings when this feature is rolled out, and we'll need to
handle each individually.

When we do detect a time dimension on a WMTS layer, we no longer
expose this in the same way as other non-time dimensions. The browser
panel does not show the dimension values, and adding the layer
via Data Source Manager no longer prompts the user to pick from
the available time values. Instead, these layers are indicated with
a new "time capable raster layer" icon, and are added to a project
WITHOUT the user picking a specific time value.

Just like a WMS(T) layer, when a time-dimension enabled WMTS layer
is added to the project, it will default to the "automatic" temporal
mode, meaning that the layer will follow the temporal controller's
current time range by default. A user can then opt to show a specific
static time value for the layer through the layer's Temporal properties
page, by unchecking "Dynamic Temporal Control" and picking a specific
available time range from the "Predefined date" option. (Basically,
the user interaction and experience with a WMTS time enabled layer
is identical to with a WMS(T) layer).

Fixes #48364
2022-06-18 10:22:48 +10:00
Andrea Giudiceandrea
2c807f918b Add tests for native:setzfromraster with offset 2022-06-18 05:44:28 +10:00
uclaros
6e0eb8d4ca fix qgsgeometryrubberband on rotated canvas 2022-06-17 10:41:04 +10:00
Nyall Dawson
221e63cdfa Add icon to QgsProviderMetada 2022-06-16 13:55:09 +10:00
Nyall Dawson
9d0cb90705 Make virtual layer source layer creation much more user friendly
Instead of just forcing the user to type a free-form source string,
add a "..." button which allows them to browse for the layer source
using the browser dialog. Makes it MUCH easier for users to add
gpkg/postgis/wfs/... layers as sources for virtual layers.
2022-06-16 13:55:09 +10:00
Nyall Dawson
c1dbc90d30 [db manager] Don't load preview layers into project
Fixes #47159
2022-06-16 13:54:55 +10:00
pathmapper
4344d083ec Make sipify_all.sh happy
This change was made when running sipify_all.sh .
2022-06-16 08:21:05 +10:00
Nyall Dawson
21479e0814 Add QgsProviderRegistry.providersForLayerType method to list all providers supporting a layer type 2022-06-15 15:04:05 +10:00
Nyall Dawson
fc9b6053cf Add QgsProviderMetadata::supportedLayerTypes() so that we can
query the layer types supported by a data provider
2022-06-15 15:04:05 +10:00
Nyall Dawson
ff145d38ff Add __repr__ for QgsLayoutTableColumn 2022-06-13 17:33:52 +10:00
Nyall Dawson
48071fa228 Alternative fix for #43744
Fixes #48965
2022-06-13 17:33:52 +10:00
Sandro Santilli
8c18fa28b6 Drop gpkg_metadata_reference_column_name_update trigger generated by GDAL < 2.4.0
Presence of this trigger results in QGIS dropping it whenever the file
is opened in read-write mode (as it happens with vector layer is
created from it)

See https://github.com/qgis/QGIS/issues/48937#issuecomment-1152726973
2022-06-11 01:35:14 +02:00
Nyall Dawson
0e28ab5148 Also expose data defined control over scalebar height and subdivision
height, right number of subdivisions
2022-06-09 19:04:45 +10:00
Nyall Dawson
1df43e05bd Use "minimum"/"maximum" to meet API conventions 2022-06-09 19:04:45 +10:00
Ethan Snyder
c14f9144f2 Made changes per review comments from Nyall. 2022-06-09 19:04:45 +10:00
Ethan Snyder
abcb631b3e Updated sip files for the layout scalebar and the layout object. 2022-06-09 19:04:45 +10:00
vcloarec
f898dcd0eb SIP, typo, cleaning and more tests 2022-06-09 01:55:48 -04:00
bdm-oslandia
9b0bb2ffb5 add tests and fix spellcheck (compatiblity by compatibility) 2022-06-09 10:05:15 +10:00
bdm-oslandia
60db820f19 Replace all use of 'referer' http header as single var by QgsHttpHeader class
* add wrappers in QgsHttpHeader to read from/write to QMap, QUrlQuery, DomElement
* add QgsHttpHeader in QgsDataSoureUri, QgsXyzConnection, QgsVectorTileProviderConnection::Data, QgsWmsAuthorization
* fix tests
2022-06-09 10:05:15 +10:00
bdm-oslandia
cb436fe3d6 Fixes for bad key names
* fix QgsHttpHeaders:
  * when key contains double //
  * clean old sub group before adding new key to avoid duplicate

* fix QgsHttpHeaderWidget:
  * QTableWidgetItem flags for value was not set
  * call to QTableWidget edit function fail
  * table was not cleaned properly when adding entries

* fix QgsHttpHeaders test
2022-06-09 10:05:15 +10:00
bdm-oslandia
ed0236782d Fix issue #48532
* add constructor without QgsSettings, using default
* add new const QgsHttpHeaders::KEY_REFERER
* add test for QgsOwsConnection
* QgsOwsConnection:
  * fix usage of "referer" by using QgsHttpHeaders
  * replace "qgis/" prefix by QgsSettings::Prefix::QGIS
2022-06-09 10:05:15 +10:00
Jean Felder
a72dcb33fd
qgs3dmapsettings: Store debug overlay enabled flag
This stores the debug overlay visibility flag (mIsDebugOverlayEnabled)
even if it cannot be used (it needs at least Qt version 5.15). Its
default value is set to false to prevent any issue if the debug
overlay cannot be enabled.
This parameter is transient: it is not saved in the project
parameters.

The next commit will allow to this change this setting with
Qgs3DMapConfigWidget.
2022-06-08 17:29:27 +02:00
uclaros
bb767336e7 fix docstrings 2022-06-08 09:41:57 +10:00
Mathieu Pellerin
ac7b711dea Fix setting min/max through histogram doesn't activate contrast
enhancement algorithm

The commit also makes the histogram work for the single band pseudo color
raster renderer.
2022-06-06 17:12:54 +10:00
Nyall Dawson
486d3611ae Move more labeling enums to qgis 2022-06-03 18:20:03 +10:00
Nyall Dawson
7228526445 Further rework overlap/ always place label handling
- Move settings to be feature level, not layer level, and permit
data defined control of these settings
- Add additional option for overlap handling for "Always allow"
overlaps, which indicates that the user doesn't care at all
if the label overlaps other labels and that the ideal placement
should always be used for the label regardless of whether it
overlaps labels or not

To clarify further, the options are:

- Never Overlap : never ever place overlapping labels for the layer,
even if it means labels will be missing
- Allow Overls if Required: if the label can't otherwise be placed,
draw an overlapping label. This mode will cause the label to be moved
a less ideal placement if possible, e.g. moving the label further
from the center of a line or polygon, IF doing so will avoid overlapping
labels. But if there's no other positions possible, then draw the
label overlapping.
- Always Allow Overlaps": It doesn't matter at all if the label
overlaps other labels or obstacles, that's fine to do and the best
placement (e.g most central placement) should always be used even if an
alternate further placement is possible which avoids overlaps entirely.
2022-06-03 18:20:03 +10:00
Nyall Dawson
b337958277 Add missing file 2022-06-03 18:20:03 +10:00
Nyall Dawson
8bb64a0683 Split existing "Show all labels (including colliding labels)" into
two separate new options

This setting was ambiguous in meaning -- it could be interpreted
as either:

"I don't care about overlapping labels, use them when
you have no other choice"

OR

"I want to see labels for EVERYTHING in this layer, and I don't
care what you have to do to show me those"

This leads to situations like those discussed in #41043, where some
users interpret the setting as the first meaning and get confused
when eg. a curved label line layer starts showing horizontal placements
for some features which couldn't otherwise be labeled (eg short
lines).

So, split the setting into two new options (checkboxes) with explicit, clear
distinction:

- "Allow overlapping labels if unavoidable": This setting means labels
can be overlapping, if there's no other option. It does NOT gaurantee
that all features in the layer will have labels, because other
constraints (such as lines too short to fit a label's text) will still
be respected and may prevent labels for the feature.

- "Allow inferior fallback placements": This mode permits features
to fallback to worse placement options when there's no other choice,
e.g. when a line is too short to fit a curved label text then the
label may be placed horizontally just over the feature's center
point.

The combination of checking BOTH options WILL gaurantee that
all features in the layer are labelled, albeit with both overlapping
labels and the degraded placements!

Fixes #41043
2022-06-03 18:20:03 +10:00
Nyall Dawson
6e5a99d332 Sipify 2022-06-03 13:13:43 +10:00
Nyall Dawson
41d5e50766 Spelling 2022-06-03 12:02:13 +10:00
Nyall Dawson
c97f3ec8d6 Rename to isTransformationPossible 2022-06-03 12:02:13 +10:00
Nyall Dawson
1097f85a6c Fix typo 2022-06-03 12:02:13 +10:00
Nyall Dawson
7edcb9899e Add a constructor flag to QgsCoordinateTransform to ignore impossible
transformations, such as those which happen across different
celestial bodies

If set, the flag indicates that no user-facing warnings should be
shown and instead the transform should be short circuited
2022-06-03 12:02:13 +10:00
Nedjima Belgacem
8054467031
Save calculated statistics of a COPC file back into the dataset as an EVLR record (#48673)
* Implement saving stats as an EVLR

* Fix layout tests

* don't save statistics unless copc was generated by pdal

* Address Martin reviews

* Address reviews

* Only read stats EVLR and do not store count

* merge cleanup

* Address reviews
2022-06-02 19:24:03 +02:00
bdm-oslandia
faa8877160 add new 3Daxis option page in 3d settings
* add Qgs3DAxisSettings class to handle 3d axis parameters
* remove 3daxis configuration from 3d navigation widget
2022-06-02 16:58:30 +02:00
Even Rouault
21f6091e4a
Merge pull request #48820 from DelazJ/patch-21
Replace POINT_CLOUD_LAYER with POINTCLOUD_LAYER in docstring
2022-06-01 22:18:53 +02:00
Harrissou Sant-anna
8f296b1c61
Replace POINT_CLOUD_LAYER with POINTCLOUD_LAYER in docstring 2022-06-01 13:53:06 +02:00
Nedjima Belgacem
e0348f8a62
Merge branch 'master' into point-cloud-stats-cleanup 2022-05-31 15:51:54 +01:00
NEDJIMAbelgacem
904a987c42 fix python test 2022-05-31 15:47:34 +01:00
Nyall Dawson
a3e72bdc52 Ensure that all units are changed when setting output unit for a symbol
Fixes #45961
2022-05-31 16:11:55 +10:00