139 Commits

Author SHA1 Message Date
vcloarec
c3611c60a1 create postgres RO connection in the thread where the provider live 2023-07-19 10:10:11 +02:00
Nyall Dawson
61a3f44e98 Provider registry tiled mesh file handling support 2023-06-28 17:39:09 +10:00
Nyall Dawson
80f97c5e72
Implement responsive cancelation also for fields retrieval 2023-06-13 10:55:38 +10:00
Nyall Dawson
e036570c77 Setup framework for data provider's to provide information about
elevation related properties to their layers

And use this to ensure that wms tiles with maptiler terrain
or terrarium terrain interpretation are always included by
default in elevation profile plots.

Most specifically, this ensures that projects containing the
out-of-the-box "Mapzen Global Terrain" layer will be automatically
included in elevation plots.
2023-05-19 23:06:21 +10:00
Vincent Cloarec
e2fa27e4a6
Load layers in parallel threads when opening project (#53069)
* load layers in parallel threads when opening project

* parallel loading by default and settingsin advanced settings

* fix freezing when no layer supports parallel loading

* clean leftover

* fix unwanted remove and typo

* typo

* fix flake8

* load OGR metadata under global mutex

* Revert "load OGR metadata under global mutex"

This reverts commit adcaf9e66ca432ee35143c45af2b383108770a63.

* remove parallel loading capability for OGR

* start application in server test

* import start_app

* fix flake8
2023-05-18 16:11:43 +02:00
Nyall Dawson
9aac2b8d8a [api] Add framework for setting field comments/aliases via
QgsAbstractDatabaseProviderConnection

When implemented by providers, will provide a method for
permanently setting field aliases/comments within a
database

Here we have no choice but to create a new Capability2
enum, as the original Capability has now consumed the
entire range of values for data types permitted by QFlag
2023-04-18 08:22:57 +10:00
Nyall Dawson
fd11e0b45d Add file filter handling for vector tile layers to QgsProviderMetadata
And move QgsProviderMetadata.FilterType to Qgis
2023-04-02 20:04:02 +10:00
Nyall Dawson
50c76929e1
Followup 30700f1, ensure links to Qgis members are set in docstrings 2023-03-31 10:46:24 +10:00
Martin Dobias
289f47690d
Refactor QgsMapLayer's encodedSource()/decodedSource() (#51901)
Conversion between relative and absolute paths when reading/writing project files
has been inconveniently done in subclasses of QgsMapLayer in encodedSource() and
decodedSource() methods, with a lot of provider specific code.

This is a refactoring to finally fix this - there is a new pair of functions added
to QgsProviderMetadata and QgsProviderRegistry:
- absoluteToRelativeUri()
- relativeToAbsoluteUri()

This new pair of functions delegates the actual conversion between absolute and
relative path to provider code - where it belongs.

The existing code from encodedSource() and decodedSource() functions has been moved
to providers. Unit tests were added to confirm the existing behavior.

There should be no change of behavior apart from removal of old compatibility code
for WMS provider for projects from QGIS < 1.9 (10 years ago).
2023-02-22 17:53:44 +10:00
Nyall Dawson
046883fa9c Promote QgsWkbTypes enums to enum class, move to Qgis 2023-02-22 12:39:21 +10:00
Nyall Dawson
1142e8ffac
Move QgsMapLayerType enum to Qgis.LayerType (#51874)
For consistency with other enums
2023-02-16 13:02:57 +01:00
Even Rouault
bac117e4f1
Merge pull request #51144 from rouault/wfs_sublayers
[WFS] Improve support of layers with unknown geometry type with Deegree servers
2023-01-09 06:14:09 +01:00
Mathieu Pellerin
cf0dae76b2 [processing] Don't load default style when creating a memory sink 2023-01-07 10:21:37 +07:00
Even Rouault
8866b0cdad
QgsProviderSublayerTask: make it possible to restrict it to a particular provider
Avoids the 'ERROR: Status 2: File  pagingEnabled='false'
preferCoordinatesForWfsT11='false' restrictToRequestBBOX='1'
srsname='EPSG:25832' typename='dvg:nw_dvg1_bld'
url='https://www.wfs.nrw.de/geobasis/wfs_nw_dvg' version='auto' could
not be found' type of message in the scenario described by
https://github.com/qgis/QGIS/pull/51144#issuecomment-1345507627
2023-01-04 00:15:28 +01:00
Even Rouault
541da34602
Add a QgsProviderMetadata:suggestGroupNameForUri() method and implement it for WFS to have WFS sublayers put in a group 2023-01-04 00:15:27 +01:00
Nyall Dawson
108934648f Add method to get list of supported related table types for a connection 2022-12-01 12:03:12 +10:00
Nyall Dawson
026f3cdf7b Add api to retrieve illegal field names via connections api 2022-12-01 06:56:24 +10:00
Nyall Dawson
7a3a57a562 Add API to retrieve relationship capabilities for a provider connection 2022-12-01 06:56:03 +10:00
Nyall Dawson
30899be07d Add update and delete relationship api 2022-11-30 11:27:37 +10:00
Nyall Dawson
ff3048d19a [api] Add method for creating relationship to QgsAbstractDatabaseProviderConnection
and implement for OGR provider when built on GDAL >= 3.6
2022-11-30 11:27:37 +10:00
Nyall Dawson
44361ba352 Add flag to opt into including system tables in QgsAbstractDatabaseProviderConnection tables listings 2022-11-29 10:20:46 +01:00
Alessandro Pasotti
cfe180fdfe Doxy 2022-11-07 18:35:23 +01:00
Alessandro Pasotti
9c2923aa1d Optionally load all stored styles from DB with correct names.
Fixes #37434

Funded by: Ministère des Forêts, de la Faune et des Parcs - Québec
2022-11-07 10:16:04 +01:00
Alessandro Pasotti
b7a608268c When the default style is read from the DB use its real name
Partial fix for 37434
2022-11-04 16:51:34 +01:00
Stefanos Natsis
ba97282dd0
Allow hiding empty layers in sublayers dialog (#49870)
* Sublayers dialog improvements

* added tests

* fix flake

* check against DisplayRole instead of EditRole
2022-10-21 10:53:49 +00:00
rldhont
0fc64b101a feat: Open layers in a read only mode with Qgis::ProjectReadFlag::ForceLayerReadOnly
In most cases of use of QGIS Server, it is not necessary to access the layers in write mode.
The read-only mode is sufficient.

We would like to introduce a new flag Qgis::ProjectReadFlag::ForceLayerReadOnly to
open layers in a read-only mode.
2022-09-12 09:17:02 +10:00
Alessandro Pasotti
0c577f07ba
Merge pull request #50015 from elpaso/layer-metadata-provider
Layer metadata provider API (part 1)
2022-09-01 13:58:22 +02:00
Alessandro Pasotti
eb76172122 Raise proper exceptions from search 2022-09-01 11:32:13 +02:00
Alessandro Pasotti
fa55567ecf Rename QgsLayerMetadataSearchResults 2022-09-01 08:21:15 +02:00
Nyall Dawson
2aa753cb72 Typo 2022-09-01 08:55:08 +10:00
Alessandro Pasotti
b87ae9053f Refactoring after PR review 2022-08-31 18:57:04 +02:00
Alessandro Pasotti
35403d507f Layer metadata provider API
Implementation of QEP #250 DB metadata storage.

- General API for registering layer metadata providers
- Metadata provider GPKG
- Metadata provider POSTGRES
- Metadata provider POSTGRES RASTER

Tests and custom python metadata provider implementation.

No GUI.

Funded by: ARPA Piemonte
2022-08-31 18:53:12 +02:00
Nyall Dawson
73692a6a41 Create QgsProviderSqlQueryBuilder
QgsProviderSqlQueryBuilder provides an interface for creation of SQL queries, which
can be overridden for backend provider specific SQL syntax.

Initially add a virtual method for creation of row limited select *
queries.
2022-08-28 15:37:15 +10:00
Nyall Dawson
fe7964bb1a Show sublayers in a tree, respecting schema/dataset groupings where known 2022-08-02 17:20:37 +10:00
Nyall Dawson
e9e6756c12 Add method to convert QgsProviderSublayerDetails to mime uris 2022-08-02 17:20:37 +10:00
Nyall Dawson
7236b50930 Add QgsAbstractDatabaseProviderConnection interface for retrieving relationships for a database 2022-08-02 15:44:40 +10:00
Nyall Dawson
6dfa7e260c Make provider connection multi type handling more granualar, and use
new API in GDAL 3.6 to determine whether or not the multi
linestring/polygon types should be exposed for new table creation
2022-08-01 13:18:58 +10:00
Nyall Dawson
65f700e700 Use enum classes for ArcGIS REST service types for clarity 2022-07-21 06:46:31 +10:00
Nyall Dawson
aa9c6f60c6 Add method to convert field to JSON definition 2022-07-18 21:21:12 +10:00
Nyall Dawson
fe7407b29c Add more fine-grained control of what to include when converting
features to JSON
2022-07-18 21:21:12 +10:00
Nyall Dawson
6da633d998 Allow skipping of geometry in json 2022-07-18 21:21:12 +10:00
Nyall Dawson
7da574fe36 Add QgsAbstractDatabaseProviderConnection interface for renaming fields
And implement for OGR connections. Also expose the ability to rename
existing fields for supported database connections via browser.
2022-07-18 17:26:13 +10:00
Nyall Dawson
6fd8f424a2 Handle time zones 2022-07-16 16:46:44 +10:00
Nyall Dawson
300e2b2d89 Add method to convert QgsFeatures to ArcGIS REST representation 2022-07-16 16:46:44 +10:00
Nyall Dawson
9548e767c4 Add method to convert crs to ArcGIS REST JSON 2022-07-16 16:46:44 +10:00
Nyall Dawson
484bea7c34 Add API methods to convert QgsGeometry to an ArcGIS REST representation 2022-07-16 16:46:44 +10:00
Nyall Dawson
2321ba41ce Add interface for QgsProviderMetadata::createDatabase
Can be used on a supported provider to create a new empty database
at a specified URI.
2022-07-14 11:54:21 +10:00
Nyall Dawson
8dc9635dbc Only offer to create supported domain types 2022-07-13 06:44:58 +10:00
Nyall Dawson
221e63cdfa Add icon to QgsProviderMetada 2022-06-16 13:55:09 +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