[QGIS-Developer] How to split QGISMapLayer attribute "source" into parts (python)

Bo Victor Thomsen bo.victor.thomsen at gmail.com
Thu Apr 25 04:19:35 PDT 2019


Hi all -

I have a python plugin where I iterate through all vectorlayers and get the
source for each layer using

mySource = myVectorLayer.source()

The result could be something like this: (one line)

restrictToRequestBBOX='1' srsname='EPSG:25832'
typename='dai:theme-pg-natura2000_omraader_habitatnatur' url='
http://wfs2-miljoegis.mim.dk/dai/ows?version=1.1.0' table="" sql=

The question:  - How can i split this string into parts ? (In this
case: restrictToRequestBBOX,
srsname, typename, url, sql)

The obvious method is to use ex.:   myList = mySource.split(' ')

But that depends on that no part id or value contains a "blank"

Is there a more secure method to do the spiltting?

-- 
Med venlig hilsen / Kind regards

Bo Victor Thomsen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190425/f738eb0e/attachment.html>


More information about the QGIS-Developer mailing list