title: how to export images from an openstreetmap server?
body: <p>Good morning everyone,
  i'll try to explain the whole situation here: I have a website (django-python) that shows a map using Openlayers. The map has two layers: a background that shows the city names and streets and for that i use openstreetmaps; the second layer contains some greographic information , for that i use MapServer (more specifically,i send the bbox parameter and other stuff to my server and generates the map via mapscript for python).</p>
  
  <p>Now i want to have an "export" button in my website, that must create a .zip file containing an image of the map (among charts and files included in the .zip), so i have to be able to generate the same map that was shown in the openlayers and save it into a file or directly into the .zip.</p>
  
  <p>My first guess was that i could get the coordinates (BBOX) from the openlayers, send those coordinates to python and via url and python could call both servers (mapserver an openmapstreets), save the image in the .zip file... but life is not that easy isn't it?
  Well it works fine for the mapserver layer, the urls is something like:</p>
  
  <p><a href="http://myserver/mapscript/?LAYERS=selection&amp;FORMAT=png&amp;BBOX=466501.93337405,6631240.3024181,750661.93337405,6853960.3024181&amp;WIDTH=555&amp;HEIGHT=435" rel="nofollow noreferrer">http://myserver/mapscript/?LAYERS=selection&amp;FORMAT=png&amp;BBOX=466501.93337405,6631240.3024181,750661.93337405,6853960.3024181&amp;WIDTH=555&amp;HEIGHT=435</a></p>
  
  <p>but when i try to call the openstreetmaps with the same coordinates, it gives me an error :</p>
  
  <p><a href="http://openstreetmapserver/?LAYERS=osm_l93&amp;FORMAT=png&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=&amp;EXCEPTIONS=application%2Fvnd.ogc.se_inimage&amp;SRS=EPSG%3A2154&amp;BBOX=466501.93337405,6631240.3024181,750661.93337405,6853960.3024181&amp;WIDTH=256&amp;HEIGHT=256" rel="nofollow noreferrer">http://openstreetmapserver/?LAYERS=osm_l93&amp;FORMAT=png&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=&amp;EXCEPTIONS=application%2Fvnd.ogc.se_inimage&amp;SRS=EPSG%3A2154&amp;BBOX=466501.93337405,6631240.3024181,750661.93337405,6853960.3024181&amp;WIDTH=256&amp;HEIGHT=256</a></p>
  
  <pre><code>An error occurred: can't find resolution index for 1110.000000. Available resolutions are: [4096.0, 2048.0, 1024.0, 512.0, 256.0, 128.0, 64.0, 32.0, 16.0, 8.0, 4.0, 2.0, 1.0, 0.5, 0.25]
  </code></pre>
  
  <p>so now... i dont know how to call the OSM to generate an image for the coordinates that i give him.. i looked in the openstreetmaps an exemple of export an i think they use the coordinates in some other format maybe??</p>
  
  <pre><code>http://tile.openstreetmap.org/cgi-bin/export?bbox=-1.81,44.71,9.26,50.53&amp;scale=3500000&amp;format=png 
  </code></pre>
  
  <p>If you have any idea how to proceed i'd be great!!!!</p>