[Qgis-developer] QgsMapLayer.source() for a WFS now returns a different string

Even Rouault even.rouault at spatialys.com
Wed Jul 20 04:57:40 PDT 2016


Le mercredi 20 juillet 2016 11:57:19, Tom Chadwin a écrit :
> I was retrieving the URL of a WFS layer, and formatting it for Leaflet as
> follows:
> 
> layerSource = layer.source()
> layerSource += "&outputFormat=text%2Fjavascript&"
> layerSource += "format_options=callback%3AmyCallback"
> wfsVars += ('' % layerSource)
> 
> This no longer works, because source() on a WFS layer now (2.16 Win7x64)
> returns a string of the format:
> 
> retrictToRequestBBOX='1' srsname='EPSG:27700'
> typename='yorkshire_dales:ydnpa_route_accessibility'
> url='http://maps.nationalparks.gov.uk/geoserver/wfs' table="" sql=
> 
> When did this change?

in 2.16

> And can I retrieve the URL as I did before, or am I
> going to have to hack this new string around to build the WFS URL?

You can use QgsDataSourceURI.param("url") to retrieve the url parameter. You 
'll need to augment it with SERVICE, VERSION and REQUEST parameters to form a 
valid GetFeature request.

> 
> Thanks
> 
> Tom
> 
> 
> 
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/QgsMapLayer-source-for-a-WFS-now-retur
> ns-a-different-string-tp5277278.html Sent from the Quantum GIS - Developer
> mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the Qgis-developer mailing list