Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Source select configure from uri (Request in QGIS) #8892

Closed
qgis-bot opened this issue Feb 27, 2024 · 0 comments · Fixed by #9091
Closed

FEATURE: Source select configure from uri (Request in QGIS) #8892

qgis-bot opened this issue Feb 27, 2024 · 0 comments · Fixed by #9091
Labels
3.36 QGIS 3.36 new features Browser Features of the browser panel Managing Layer/Data Creating and loading layers as well as formats handling or specifics Properties
Milestone

Comments

@qgis-bot
Copy link
Collaborator

Request for documentation

From pull request qgis/QGIS#54844
Author: @elpaso
QGIS version: 3.34

FEATURE: Source select configure from uri

PR Description:

This PR adds an API for source select widgets and data source manager that allows to open and configure the data source manager from a data source URI.

For instance:

registry = QgsGui.sourceSelectProviderRegistry()
# Check for capability
registry.providers()[0].name()
'ogr'
bool(registry.providers()[0].capabilities() & QgsSourceSelectProvider.Capability.ConfigureFromUri)
True
source_select_provider = registry.providers()[0]
widget = source_select_provider.createDataSourceWidget()
widget.configureFromUri('/path/to/file.gpkg|layername=points')
True

The datasource manager dialog has also a C++ API:

    /**
     * Shows the page \a pageName and configure the source select widget from the layer \a uri.
     * \since QGIS 3.38
     */
    void configureFromUri( const QString &pageName, const QString &uri );

The dialog will open on the correct page with pre-filled values to open the layer.

This feature is for now implemented for OGR (including the dedicated GPKG source select), GDAL and Spatialite and it is accessible from the context menu in the browser.

The purpose is to allow the user to set opening options when adding a layer from the browser but it could be eventually expanded to include a more sophisticated replace data source functionality where opening options can be specified.

Here is the exposed UI

configure_from_uri_gpkg_vector

configure_from_uri_gpkg_raster

A secondary patch (for GDAL >= 3.8 only, and part of the same work package) in this PR is related to a very peculiar use case when opening VR BAG (variable resolution) files, in case no opening options are explicitly specified by the user the MODE=INTERPOLATED option is used as a default.

configure_from_uri_bag

Funded by: NOAA

Commits tagged with [need-docs] or [FEATURE]

@github-actions github-actions bot added the 3.34 label Feb 27, 2024
@github-actions github-actions bot added this to the QGIS 3.40 milestone Feb 27, 2024
@DelazJ DelazJ added Managing Layer/Data Creating and loading layers as well as formats handling or specifics Properties Browser Features of the browser panel 3.36 QGIS 3.36 new features and removed 3.34 labels Feb 27, 2024
@selmaVH1 selmaVH1 added this to In progress in Selma Work Planning Apr 26, 2024
@selmaVH1 selmaVH1 moved this from In progress to Review in progress in Selma Work Planning May 13, 2024
Selma Work Planning automation moved this from Review in progress to Done May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.36 QGIS 3.36 new features Browser Features of the browser panel Managing Layer/Data Creating and loading layers as well as formats handling or specifics Properties
Projects
Development

Successfully merging a pull request may close this issue.

2 participants