<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 2013-03-15 23:21, A.Pirard.Papou
      wrote :<br>
    </div>
    <blockquote cite="mid:51439EF7.80106@gmail.com" type="cite">
      <div class="moz-cite-prefix"> On 2013-03-08 15:42, Travis Kirstine
        wrote :<br>
      </div>
      <blockquote
cite="mid:CALtm4h28DPh9gLhjVeP6yGK1DNk9rBC-nbrAMknm3DT10z23Fw@mail.gmail.com"
        type="cite">
        <div dir="ltr">
          <div>
            <div>
              <div>
                <div>Current MapProxy does not support direct connection
                  to the ArcGIS REST API using the export map call. 
                  Fortunately ArcGIS server is able to publish WMS
                  services as well and you should be able to use the
                  standard WMS connection.  If you are not familiar with
                  ArcGIS server you can view the "catalog" of service
                  published and determine if WMS is support (not by
                  default) ...<br>
                </div>
              </div>
            </div>
          </div>
        </div>
      </blockquote>
      Thanks to Travis I was able to access some of that server's maps
      with WMS.  But not all its maps support WMS.  I was however able
      to trick mapproxy into loading the correct "export map" images
      with a hacked WMS configuration.  But the size of the image was
      incorrect.<br>
      The only thing missing in the request is   &size=705,509 
      instead of  &width=705,&height=509<br>
      <br>
      I have verified that WMS and ArcGIS "disregard noise", i.e. they
      will both accept 
      "&size=705,509&width=705,&height=509".  In other
      words, one can make the requests "bilingual".<br>
      Mapproxy makes no other calls than equivalent to the one below,
      does it?<br>
      _ts seems unnecessary.<br>
      <br>
      But I do not know python enough to modify the program to do that
      (/usr/share/pyshared/mapproxy/request/wms/__init__.py ?).<br>
      <br>
      If someone could sketch precisely how to add that 
      &width=<w>,&height=<h> to a WMS request, I
      would make the update, test it, most probably extend the "feature"
      to the other bilingual parameters and return the update to the
      community.<br>
      <br>
      Cheers, <br>
      <br>
      <table>
        <tbody>
          <tr>
            <td valign="top">André.</td>
          </tr>
        </tbody>
      </table>
      <br>
      <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://geoservices.wallonie.be/arcgis/rest/services/TOPOGRAPHIE/PICC/MapServer/export?dpi=96&transparent=true&format=png8&bbox=237697.72401485278,135612.54079507195,240495.69836080144,137632.63858526756&bboxSR=31370&imageSR=31370&size=705,509&_ts=1362703550248&f=image">http://geoservices.wallonie.be/arcgis/rest/services/TOPOGRAPHIE/PICC/MapServer/export?dpi=96&transparent=true&format=png8&bbox=237697.72401485278,135612.54079507195,240495.69836080144,137632.63858526756&bboxSR=31370&imageSR=31370&size=705,509&_ts=1362703550248&f=image</a><br>
    </blockquote>
    Hi,<br>
    <br>
    No reply, but ...<br>
    THANKS again Travis who taught me and now THANKS to my friend Jo !!!<br>
    I don't speak a word of Python (just a few notes of Cobra with a
    flute ;-)) but I spent my life dissecting any code and I explained
    Jo in detail and pointed him to the right Python modules. And...<br>
    <br>
    On 2013-04-18 23:22, Jo wrote :<br>
    <blockquote
cite="mid:CAJ6DwMBnjkjoTG_yx2MRijyUDGZUqJpBm94XrfYNC798yr9ukg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>Maybe like this:<br>
              <br>
              [request/base.py]<br>
              <pre>def query_string(self):
        """
        The map request as a query string (the order is not guaranteed).
        
        >>> RequestParams(dict(foo='egg', bar='ham%eggs', baz=100)).query_string
        'baz=100&foo=egg&bar=ham%25eggs'
        """
        kv_pairs = []
        self.params['size']=self.params['width'] + ',' + self.params['height']
        for key, values in self.params.iteritems():
            value = ','.join(str(v) for v in values)
            kv_pairs.append(key + '=' + urllib.quote_plus(value, safe=','))
        return '&'.join(kv_pairs)</pre>
            </div>
            Let me know if it works,<br>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    AND IT DOES!!! <br>
    I configured MapProxy as follows:<br>
    <br>
    <blockquote type="cite">  SPW_BASE_source:<br>
          type: wms<br>
          supported_srs: ['EPSG:31370']<br>
          image:<br>
            transparent_color: '#ffffff'<br>
            transparent_color_tolerance: 20<br>
          req:<br>
            url:
<a class="moz-txt-link-freetext" href="http://geoservices.wallonie.be/arcgis/rest/services/TOPOGRAPHIE/PICC/MapServer/export">http://geoservices.wallonie.be/arcgis/rest/services/TOPOGRAPHIE/PICC/MapServer/export</a>?<br>
            dpi: 96<br>
            bboxSR: 31370<br>
            imageSR: 31370<br>
            f: image<br>
            transparent: true<br>
            format: png8<br>
      ########## &format=image=png<br>
    </blockquote>
    <br>
    and now I have bilingual requests like this:<br>
    <br>
    [2013-11-19 00:04:44,055] mapproxy.source.request - INFO - GET
<a class="moz-txt-link-freetext" href="http://geoservices.wallonie.be/arcgis/rest/services/TOPOGRAPHIE/PICC/MapServer/export?styles=&service=WMS">http://geoservices.wallonie.be/arcgis/rest/services/TOPOGRAPHIE/PICC/MapServer/export?styles=&service=WMS</a><b>&format=image%2Fpng</b>&<b>f=image</b>&request=GetMap&<b>dpi=96</b>&height=1184&srs=EPSG%3A31370&version=1.1.1&<b>bboxSR=31370</b>&bbox=234355.499252,140451.789859,236183.948366,142275.440871&<b>imageSR=31370</b>&width=1187&transparent=True&<b>size=1187,1184</b>
    200 43.7 19366<br>
    <br>
    There's a little hitch, however.  Wouldn't life be dull without? ;-)<br>
    My &format=png8 is overridden by Oliver's &format=image/png
    :-(<br>
    Not a big deal if it works, but isn't it logical and wouldn't it be
    possible that user specified keys override the others (would be
    applied last)?<br>
    <br>
    Things go better even without Coca Cola ;-)<span class="k"><br>
      for</span> <span class="n">i</span> <span class="ow">in</span> <span
      class="nb">range</span><span class="p">(</span><span class="mi">0</span><span
      class="p">,</span> 999<span class="mi"></span><span class="p">):</span>
    print 'THANKS '
    <span class="gp"></span><br>
    <br>
    Cheers,<br>
    <br>
    <table>
      <tbody>
        <tr>
          <td>André.</td>
        </tr>
      </tbody>
    </table>
    <br>
  </body>
</html>