[MapProxy] Caching styles

Tom Kralidis tomkralidis at gmail.com
Wed Mar 10 10:28:03 PST 2021


Hi: (Tom C and I are working together on the below).  More info:

We have a given WMS layer which has, say, 6 styles and are finding that we
have to setup
a distinct cache/source/layer definition for each layer/style combination.
Users hitting
MapProxy would submit STYLES=, to which MapProxy would then issue STYLES=foo
(for example) to the upstream WMS given this is configured in MapProxy
config.

When we configure a layer with NO styles defined in the MapProxy
configuration, and issue
a STYLES=foo request, MapProxy throws an exception (the style exists in the
upstream server).

Are we able to setup a single layer definition which allows for STYLES to
be passed through?  Or
do we have to setup a cache/source/layer definition for each layer/style
combination?  See [1]
for a sample configuration.

Thanks

..Tom

[1] https://gist.github.com/tomkralidis/ad89794f1fd0394842fc3cad9e5234f3





On Mon, Mar 1, 2021 at 10:58 AM Rahkonen Jukka (MML) <
jukka.rahkonen at maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> The GetMap request looks correct to me. Does it give an error also if you
> send it with a browser? If it does, and if that style is really advertised
> for that layer in the GetCapabilities then it feels like a server side
> issue.
>
>
>
> -Jukka Rahkonen-
>
>
>
> *Lähettäjä:* MapProxy <mapproxy-bounces at lists.osgeo.org> *Puolesta *Cooney,
> Tom (EC)
> *Lähetetty:* maanantai 1. maaliskuuta 2021 16.59
> *Vastaanottaja:* mapproxy at lists.osgeo.org
> *Aihe:* [MapProxy] Caching styles
>
>
>
> Hi,
>
>
>
> We are using MapProxy to cache our WMS server. Many of the layers are
> available in multiple styles and we wish to cache all available styles. For
> example the layer GDPS.ETA_TT is available in the following styles:
>
>    - TEMPERATURE-LINEAR
>    - TEMPSUMMER
>    - TEMPSUMMER-LINEAR
>    - TEMPWINTER
>    - TEMPWINTER-LINEAR
>    - TEMPERATURE
>
> When I make a request with the styles parameter blank I receive the
> expected image. However, whenever I add a style to the request I receive an
> error saying *StyleNotDefined">unsupported styles: TEMPSUMMER. * A
> simplified version of the config I am using is below. A sample request with
> blank style parameter and a sample request with *STYLE=TEMPSUMMER* are
> also below.
>
>
>
> How do I setup these styles in the config?
>
>
>
> Thank you for your time,
>
> Tom Cooney
>
>
>
> caches:
>   GDPS.ETA_TT_cache:
>
>     sources:
>
>     - GDPS.ETA_TT_source
>
> layers:
>
>   name: GDPS.ETA_TT
>
>   sources:
>
>   - GDPS.ETA_TT_cache
>
> sources:
>
>   GDPS.ETA__TT_source:
>
>     req:
>
>       layers: GDPS.ETA_TT
>
>       url: https ....
>
>       styles: TEMPSUMMER
>
>
>
> Request with blank styles parameter (returns the image as expected)
>
>
> http://geomet-dev-03.cmc.ec.gc.ca:8000/service?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=-90,-180,90,180&CRS=EPSG:4326&WIDTH=1351&HEIGHT=676&LAYERS=GDPS.ETA_TT&STYLES=&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE&TIME=2021-02-26T00:00:00Z
>
>
>
> Request with a style (returns *StyleNotDefined* error)
>
>
> http://geomet-dev-03.cmc.ec.gc.ca:8000/service?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=-90,-180,90,180&CRS=EPSG:4326&WIDTH=1351&HEIGHT=676&LAYERS=GDPS.ETA_TT&STYLES=TEMPSUMMER&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=T
>
>
>
>
> _______________________________________________
> MapProxy mailing list
> MapProxy at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapproxy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20210310/a0f8ce5d/attachment.html>


More information about the MapProxy mailing list