[QGIS-Developer] applying an SLD to a WMS layer

Charles Dixon-Paver charles at kartoza.com
Tue Oct 26 10:13:04 PDT 2021


Don't thank me yet! My in-between-meetings mailing list brain was at work
and I should have phrased that differently. I was actually meaning to ask
whether that would work on wms layers and I haven't tested it out

On Tue, 26 Oct 2021, 19:02 Kurt Menke, <kurt at birdseyeviewgis.com> wrote:

> Thanks Charles,
> This may be the ticket!
>
> On Tue, Oct 26, 2021 at 6:30 PM Charles Dixon-Paver <charles at kartoza.com>
> wrote:
>
>> Just to chime in, all these responses seem to be discussing sld and wms
>> server configuration options, but the original question mentioned applying
>> edits to the qgis project file. I would think the simplest solution is to
>> use something like loadSldStyle[1] from pyqgis? Not sure if I'm missing the
>> point of the conversation though.
>>
>> [1]
>> https://qgis.org/pyqgis/master/core/QgsMapLayer.html#qgis.core.QgsMapLayer.loadSldStyle
>>
>> On Tue, 26 Oct 2021 at 14:21, Jorge Gustavo Rocha <jgr at di.uminho.pt>
>> wrote:
>>
>>> Hi René,
>>>
>>> I'm just asking questions to fully understand the use case. Thank you
>>> for your feedback. You mentioned an interesting point.
>>>
>>> As you mentioned, the solution can be based on the server side if the
>>> map server accepts an SLD.
>>>
>>> This approach can not be used against WMS services working behind
>>> caches/tiling services providing only predefined styles.
>>>
>>> Regards,
>>>
>>> Jorge Gustavo
>>>
>>> On 26/10/21 12:43, René-Luc Dhont wrote:
>>> > Hi Jorge,
>>> >
>>> > WMS Server can process SLD  provide in a GetMap Request.
>>> > QGIS Server is able to apply an SLD to a layer and provide the
>>> resulting
>>> > image. The SLD can be provided through the SLD_BODY parameter or the
>>> > SLD parameter for linked file.
>>> >
>>> https://docs.qgis.org/3.16/en/docs/server_manual/services.html#qgisserver-wms-getmap
>>> > This capability is mainly exploited by web clients
>>> >
>>> > René-Luc
>>> >
>>> > Le 26/10/2021 à 12:26, Jorge Gustavo Rocha a écrit :
>>> >> Hi Kurt,
>>> >>
>>> >> By design, WMS GetMap requests returns images. Those are rendered on
>>> >> the server side, by the map server. Many services just provide those
>>> >> rendered images.
>>> >>
>>> >> Are you trying to provide advanced image processing capabilities on
>>> >> the client side to apply an SLD on top those images?
>>> >>
>>> >> Or would you like to try other GetMap formats, more friendly to
>>> >> process on the client side? Like svg or kml? Some of these formats
>>> are
>>> >> available as vendor options of the map server.
>>> >>
>>> >> Regards,
>>> >>
>>> >> Jorge Gustavo
>>> >>
>>> >>
>>> >> On 26/10/21 10:58, Kurt Menke wrote:
>>> >>> Hello,
>>> >>> We have been developing web apps that allow the user to download the
>>> >>> selected extent and data layers as a QGIS project file. Many of the
>>> >>> layers are hosted by the government as WMS services. We are
>>> wondering
>>> >>> if anyone has looked into the possibility of applying an SLD style
>>> to
>>> >>> a WMS layer in QGIS. We were hoping to be able to edit the *.qgs
>>> file
>>> >>> programmatically. We would be interested in sponsoring the effort
>>> >>> depending on the level of effort required, assuming it is even
>>> possible.
>>> >>> Best,
>>> >>> Kurt
>>> >>>
>>> >>> --
>>> >>>
>>> >>> Kurt Menke
>>> >>>
>>> >>> GIS-Consultant
>>> >>> --------------------------
>>> >>> Septima P/S
>>> >>> Frederiksberggade 19, 2nd Floor
>>> >>> 1459 Copenhagen
>>> >>>
>>> >>> Tlf: +45 5114 6444
>>> >>>
>>> >>> _______________________________________________
>>> >>> 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
>>> >>>
>>> >>
>>> >> J. Gustavo
>>> >
>>> >
>>> > _______________________________________________
>>> > 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
>>> >
>>>
>>> J. Gustavo
>>> --
>>> Jorge Gustavo Rocha
>>> Departamento de Informática
>>> Universidade do Minho
>>> 4710-057 Braga
>>> Gabinete 3.29 (Piso 3)
>>> Tel: +351 253604480
>>> Fax: +351 253604471
>>> Móvel: +351 910333888
>>> skype: nabocudnosor
>>> _______________________________________________
>>> 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/20211026/6d4795da/attachment-0001.html>


More information about the QGIS-Developer mailing list