views:

88

answers:

1

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).

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.

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:

http://myserver/mapscript/?LAYERS=selection&FORMAT=png&BBOX=466501.93337405,6631240.3024181,750661.93337405,6853960.3024181&WIDTH=555&HEIGHT=435

but when i try to call the openstreetmaps with the same coordinates, it gives me an error :

http://openstreetmapserver/?LAYERS=osm_l93&FORMAT=png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A2154&BBOX=466501.93337405,6631240.3024181,750661.93337405,6853960.3024181&WIDTH=256&HEIGHT=256

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]

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??

http://tile.openstreetmap.org/cgi-bin/export?bbox=-1.81,44.71,9.26,50.53&scale=3500000&format=png 

If you have any idea how to proceed i'd be great!!!!

+1  A: 

Maybe this example can be what you need: OpenLayers Export Map Example

billmuell
Thanks, it a useful example, although i dont want to use html5 rigth now and the i want must be on the server side... but i found my answer is in this page http://www.openstreetmap.org/export/. Now i have to find a way to merge the two maps into one single image (on server side): my map with the information from the DB, and the openstreet map as a background
pleasedontbelong