[MapProxy] uppercase values for get keys (WMSMapRequestParams)

Adon Metcalfe adon.metcalfe at gmail.com
Mon Mar 28 20:05:07 EDT 2011


Hi Oliver,

I managed to stick it in BaseRequest (optional kwarg, uppercase_keys) which
then sets an instance attribute after constructing the params, with a few
other changes to expose the config via HTTPClient. My fork is here though
its still missing test cases - https://bitbucket.org/adonm/mapproxy/overview

1st source had uppercase_keys = true, second didn't =)

www2.landgate.wa.gov.au - - [29/Mar/2011:08:00:11 ] "GET
/ows/wmsCsMosaic?LAYERS=LGATE-V001&WIDTH=512&VERSION=1.1.1&BBOX=123.75,-33.75,135.0,-22.5&SERVICE=WMS&FORMAT=image%2Fjpeg&STYLES=&SRS=EPSG%3A4326&REQUEST=GetMap&HEIGHT=512
HTTP/1.1" 200 - "-" ""
www2.landgate.wa.gov.au - - [29/Mar/2011:08:01:40 ] "GET
/ows/wmsCsCadastre?styles=&format=image%2Fpng&height=512&bbox=-180.0,-90.0,180.0,270.0&transparent=True&layers=LGATE-082&service=WMS&width=512&request=GetMap&srs=EPSG%3A4326&version=1.1.1
HTTP/1.1" 200 - "-" ""

I also noticed the new wms_tags stuff broke on integer keys in the
dictionary (integers being non iterable) so put in a check to make sure the
key was a basestring:
https://bitbucket.org/adonm/mapproxy/changeset/ec6eccb88f22#chg-mapproxy/config/loader.py

<https://bitbucket.org/adonm/mapproxy/changeset/ec6eccb88f22#chg-mapproxy/config/loader.py>When
I get a chance I'll finish some tests and submit a proper pull request.

<https://bitbucket.org/adonm/mapproxy/changeset/ec6eccb88f22#chg-mapproxy/config/loader.py>Kind
Regards,
Adon

On 28 March 2011 22:03, Oliver Tonnhofer <olt at omniscale.de> wrote:

>
> On 27.03.2011, at 04:33, Adon Metcalfe wrote:
> > I'm not exactly sure how to go about making an option that gets passed
> all the way through to the RequestParams object (maybe override query_string
> with a new WMSMapUpperRequestParams class and add a new source type
> (wms_upper?) that uses it over WMSMapRequestParams for sources requiring
> uppercase parameters?)
>
> The *RequestParams classes are subclassed a few times,
> WMS130MapRequestParams is based on WMSMapRequestParams, etc. So thats not
> feasible. I would put that into the WMSClient and then either tranform the
> URL, or call a new method of RequestParams (e.g
> request_url(uppercase_keys=True)).
>
> Regards,
> Oliver
>
> --
> Oliver Tonnhofer    | Omniscale GmbH & Co KG    | http://omniscale.de
> http://mapproxy.org | https://bitbucket.org/olt
>
>
>
>


-- 
Adon Metcalfe
Labyrinth Data Services Pty Ltd
http://www.labyrinthdata.net.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapproxy/attachments/20110329/3d7859fe/attachment.html


More information about the MapProxy mailing list