[Qgis-developer] URI

Marco Hugentobler marco.hugentobler at sourcepole.ch
Thu May 26 07:27:59 EDT 2011


Hi Radim

> 1) minimal:
>   - add WMS additional params somehow to URI + parsing in WMS provider
> (it is not clear to me why it was not done this way when WMS was
> implemented)
>   - encode / decode provider key + uri as single string only for drag and 
drop

This is ok as a short term solution. As it is possible to do redesign without 
keeping API stability, I'd prefer the maximum solutions. 

> 2) maximal A:
>   - use QUrl for all providers with providers key as scheme
> 3) maximal B:
>   - use modified QgsDataSourceURI (it is not generic, works with set
> of known params only) for all params including provider key

It seems to me QUrl is designed for network addresses. Ok, it would be 
possible to abuse some properties and interpret the query string param/values 
as the provider parameters. However, it seems cleaner to me to enhance 
QgsDataSourceURI with what we need (so +1 for 3) ). Network based providers 
can still use QUrl internally.

Regards,
Marco

Am Mittwoch, 25. Mai 2011, 09.37:26 schrieb Radim Blazek:
> Hi,
> I would like to discuss possible change of providers URI format.
> 
> Motivation:
> - Each provider is using a different way to store additional parameters in
> URI - Some providers (WMS) even don't store all parameters in URI and
> require extra methods to add a new layer: addRasterLayer(
> rasterLayerPath, baseName, providerKey, layers, styles, format, crs )
> - provider key is not part of URI, so the current URI is not
> sufficient to be used as QMimeData for drag and drop of layers to
> legend.
> 
> Current URI formats:
> OGR: data_source|layer_name
> GDAL: file_path
> PostGIS, SQLAnywhere, SQLite : space separated list of key=value
> pairs, using QgsDataSourceURI
> WMS: service URL + set of params which are not in URI
> GRASS raster: file path to cellhd
> GRASS vector: path_to_vector/layernumber_layertype
> GPX: file_path?type=type
> Delimited text, Memory: URL - using QUrl
> 
> Some possible solutions:
> 1) minimal:
>   - add WMS additional params somehow to URI + parsing in WMS provider
> (it is not clear to me why it was not done this way when WMS was
> implemented)
>   - encode / decode provider key + uri as single string only for drag and
> drop 2) maximal A:
>   - use QUrl for all providers with providers key as scheme
> 3) maximal B:
>   - use modified QgsDataSourceURI (it is not generic, works with set
> of known params only) for all params including provider key
> 
> Other issues:
>   - should it be possible to pass via URI also layer style hints?
>   - how the QGIS should recognize layer type of a dropped URI? Should
> it be a param in URI or the QGIS should recognize that from a provider
> key (asking provider)?
>   - what mime type should be used for QGIS URIs?
> 
> 
> Radim
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


-- 
Dr. Marco Hugentobler
Sourcepole -  Linux & Open Source Solutions
Churerstrasse 22, CH-8808 Pfäffikon SZ, Switzerland
marco.hugentobler at sourcepole.ch http://www.sourcepole.ch
Technical Advisor QGIS Project Steering Committee


More information about the Qgis-developer mailing list