<div dir="ltr"><div><div><div>Hi Andrea,<br><br></div>I've just posted this gist which demonstrates the approach I've used to manipulate the querystring before calling MapProxy: <a href="https://gist.github.com/walkermatt/970a1520dd4c507db57cd9c2b09b55d7">https://gist.github.com/walkermatt/970a1520dd4c507db57cd9c2b09b55d7</a><br><br></div>Hope it helps,<br><br></div>Matt.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 29 September 2017 at 11:42, Andrea Peri <span dir="ltr"><<a href="mailto:aperi2007@gmail.com" target="_blank">aperi2007@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Matt,<br>
<br>
I try to develope a simply wsgi filter following the suggests of mapproxy doc,<br>
<br>
But It don't seem to work as I hope.<br>
Infact the wsgi filter is executed after the request has reached the<br>
mapproxy, so seem to be late for ac action to change the layersname.<br>
<br>
In the config infact the order of execution is:<br>
<br>
application = make_wsgi_app(r'/....//<wbr>mapproxy.yaml')<br>
application = FilterTochangeLayerName(<wbr>application,....)<br>
<br>
So before the mapproxy do its actions on the original layer and only<br>
after the filter is able to change the layername, but is too late.<br>
<br>
I try to understand if was possible to invert the two rows.<br>
Before the filter and after the make_wsgi_app.<br>
<br>
But it seem not possible.<br>
<br>
I wrong something ?<br>
<br>
Thx,<br>
<span class="im HOEnZb">A.<br>
<br>
<br>
2017-09-25 12:24 GMT+02:00 Matt Walker <<a href="mailto:walkermatt@longwayaround.org.uk">walkermatt@longwayaround.org.<wbr>uk</a>>:<br>
</span><div class="HOEnZb"><div class="h5">> Hi Andrea,<br>
><br>
> We do something similar using a WSGI filter in front of MapProxy. In the<br>
> filter we look for DPI parameter and update the LAYERS query string<br>
> parameter to the appropriate layer based on it. Details of creating a WSGI<br>
> filter for MapProxy can be found here:<br>
> <a href="https://mapproxy.org/docs/1.10.0/auth.html" rel="noreferrer" target="_blank">https://mapproxy.org/docs/1.<wbr>10.0/auth.html</a>. Our logic DPI logic is within<br>
> the __call__ method.<br>
><br>
> Hope that helps,<br>
><br>
> Matt.<br>
><br>
> On 22 September 2017 at 12:41, Andrea Peri <<a href="mailto:aperi2007@gmail.com">aperi2007@gmail.com</a>> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> I need to change the resolution of the map returned following the dpi<br>
>> parameter from the request of the gis client.<br>
>> To do this, I try to find a solution to use a different cache folder for<br>
>> the same layer when the dpi from the request are different.<br>
>><br>
>> I try to have 2 kind of cache. One for 90 dpi and another for 300dpi.<br>
>> The layer should take from the 90 when the user do not put the dpi param<br>
>> or set explicitly the dpi=90.<br>
>> Otherwise the layer use the 300 dpi cache when the user request ask foto<br>
>> dpi=300.<br>
>><br>
>> Is this allowed with mapproxy ?<br>
>><br>
>> Manu THX.<br>
>> Andrea Peri<br>
>><br>
>><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> MapProxy mailing list<br>
>> <a href="mailto:MapProxy@lists.osgeo.org">MapProxy@lists.osgeo.org</a><br>
>> <a href="https://lists.osgeo.org/mailman/listinfo/mapproxy" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/mapproxy</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Matt Walker<br>
> @_walkermatt<br>
<br>
<br>
<br>
</div></div><div class="HOEnZb"><div class="h5">--<br>
-----------------<br>
Andrea Peri<br>
. . . . . . . . .<br>
qwerty àèìòù<br>
-----------------<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Matt Walker<br>@_walkermatt<br></div>
</div>