Hi All,<div><br></div><div>I have to use a problematic WMS (landgates virtual mosaic), in that it only accepts uppercase keys for requests, and thought I'd share the somewhat dodgy workaround (makes all request keys uppercase), which appears to work fine with all the other case insensitive services I'm using. 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?)<br clear="all">
<br></div><div><font class="Apple-style-span" face="'courier new', monospace"> @property</font></div><div><div><font class="Apple-style-span" face="'courier new', monospace"> def query_string(self):</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> """</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> The map request as a query string (the order is not guaranteed).</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> >>> RequestParams(dict(foo='egg', bar='ham%eggs', baz=100)).query_string</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" color="#FF0000"> 'BAZ=100&FOO=egg&BAR=ham%25eggs'</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> """</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> kv_pairs = []</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> for key, values in self.params.iteritems():</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> value = ','.join(str(v) for v in values)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> kv_pairs.append(<font class="Apple-style-span" color="#FF0000">key.upper()</font> + '=' + urllib.quote_plus(value, safe=','))</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> return '&'.join(kv_pairs)</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Kind Regards,</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Adon</font></div><div><br></div>-- <br>Adon Metcalfe<br>
Labyrinth Data Services Pty Ltd<br><a href="http://www.labyrinthdata.net.au">http://www.labyrinthdata.net.au</a><br>
</div>