[Qgis-developer] Detect whether layer is from QGIS Server

Alessandro Pasotti apasotti at gmail.com
Tue Jul 12 01:53:52 PDT 2016


On Tue, Jul 12, 2016 at 10:31 AM, Tom Chadwin <tom.chadwin at nnpa.org.uk>
wrote:

> Thanks - I'll try it. What do I detect in the response to know it's QGIS
> Server? In fact, does someone have a publicly accessible QGIS Server I can
> issue that request to?
>
> Thanks
>
> Tom
>
>

I think that you could check that the server does not return an exception.

If REQUEST=GetProjectSettings does not return an exception it means that
it's QGIS.


Example:
QGIS:
http://demo.qgis.org/cgi-bin/qgis_mapserv.fcgi?map=/web/demos/south_perth/project.qgs&SERVICE=WMS&REQUEST=GetProjectSettings

Not QGIS:
http://demo.mapserver.org/cgi-bin/mapserv?map=/osgeo/mapserver/msautotest/world/world.map&SERVICE=WMS&REQUEST=GetProjectSettings

-- 
Alessandro Pasotti
w3:   www.itopen.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160712/c199853a/attachment.html>


More information about the Qgis-developer mailing list