I am having trouble with my web-based application, where my tmp images are not being stored for later retrieval. The images are generated each time they have to be loaded, so zooming out and then back in to the same location requires mapserv.exe to re-generate the tiles for that view.

The application lives here: http://rinnerweb.arts.ryerson.ca/moot2

A sample map file snippet is below:

    OUTPUTFORMAT                                        #-> BEGIN OUTPUT FORMATTING DEFINITION
        NAME "png"                                      # Name of format
        DRIVER AGG/PNG                                  # Image driver
        MIMETYPE "image/png"                            # Type of image
        IMAGEMODE RGBA                                  # Image mode
        EXTENSION "png"                                 # Image filetype
        TRANSPARENT ON                                  # Transparency
    END                                                 #-> END OUTPUT FORMATTING DEFINITION

    WEB                                                 #-> BEGIN WEB DEFINITION
        IMAGEPATH "/ms4w/tmp/ms_tmp/"
        IMAGEURL "/ms_tmp/"
    END                                                 #-> END WEB DEFINITION

The web page's source will show the OpenLayers init code, but I've pasted some sample layer init code below:

hii_1 = new OpenLayers.Layer.MapServer("Land Cover","../../cgi-bin/mapserv.exe",{

Any ideas?


The temp files are automatically deleted by MapServer. If you want to cache generated images you should look at something like TileCache, MapProxy, or the MapServer's new MapCache.

Update - after requiring this myself, it is possible to force MapServer to save the images to file on the server. You need to use the CGI parameter mode=browse. See http://mapserver.org/cgi/controls.html for all CGI parameters. The image will then be saved to IMAGEPATH.

Also make sure the MAP STATUS is set to ON.

| improve this answer | |
  • thanks. learn something new everyday! would you recomend one over the other? I have 6 geotiff files being rendered by mapserver that are 65mb each. as far as raster optimization goes, they are tiled, 8bit and projected correctly. cheers. – Michael Markieta Jan 18 '12 at 6:25
  • @MichaelMarkieta - looks like I was wrong about MapServer not saving to file - you can force this mode if you wish – geographika Dec 17 '14 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.