[QGIS-Developer] QGIS Server 3 status

René-Luc Dhont rldhont at gmail.com
Wed Oct 4 05:09:47 PDT 2017


Hi,

It seems that the QGIS refactoring is complete!
https://github.com/qgis/QGIS-Enhancement-Proposals/issues/74
https://github.com/qgis/qgis3.0_api/issues/57
https://github.com/qgis/QGIS/pull/4824

You can use QGIS Server like this in Python

from qgis.server import QgsServer, QgsServerRequest, 
QgsBufferServerRequest, QgsBufferServerResponse

server = QgsServer()

qs = "?" + "&".join(["%s=%s" % i for i in list({
             "MAP": '/tmp/qgis_project.qgs',
             "SERVICE": "WFS",
             "VERSION": "1.0.0",
             "REQUEST": "GetCapabilities"
         }.items())])
requestMethod = QgsServerRequest.GetMethod
headers = {}
data = '' #can be the xml request for requestMethod = 
QgsServerRequest.PostMethod

request = QgsBufferServerRequest(qs, requestMethod, headers, data)
response = QgsBufferServerResponse()
server.handleRequest(request, response)

headers = []
rh = response.headers()
rk = sorted(rh.keys())
for k in rk:
     headers.append(("%s: %s" % (k, rh[k])).encode('utf-8'))

body = bytes(response.body())

Now QGIS Server needs somes enhancement and cleanup.

René-Luc D'Hont
3Liz

Le 04/10/2017 à 13:23, Régis Haubourg a écrit :
> Hi
>
> Yes, refactoring is now complete! see : 
> https://github.com/qgis/QGIS-Enhancement-Proposals/issues/74#issuecomment-334123595
>
> Anita, I'll draft an article tonight if you still agree to review it, 
> that would be great!
>
> Régis
>
>
>
> 2017-10-03 14:25 GMT+02:00 Anita Graser <anitagraser at gmx.at 
> <mailto:anitagraser at gmx.at>>:
>
>
>
>     On Tue, Oct 3, 2017 at 11:19 AM, Régis Haubourg
>     <regis.haubourg at gmail.com <mailto:regis.haubourg at gmail.com>> wrote:
>
>         Hi Etienne,
>
>         from my point of view, this is the perfect time to start
>         stressing QGIS server 3! We just discussed bout starting
>         working with it this morning on a new project.
>         Maybe Alessandro and René-Luc can tell us more about the
>         plugin side.
>
>         Paul is currently fixing issues raised by the OGC test
>         engines. Richard, could you find some time to expose them on a
>         public url?
>
>
>     ​What would you think about publishing a QGIS Server update on
>     blog.qgis.org <http://blog.qgis.org> once the latest information
>     has been gathered? I'd like to see Server presented and advertised
>     more ​widely.
>
>     ​I'd be glad to help write the post if someone can help with the
>     necessary insights.
>
>     Regards,
>     Anita​
>
>
>
>
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20171004/85871d11/attachment.html>


More information about the QGIS-Developer mailing list