[mapserver-dev] Re: Dynamicaly writing Mapfiles for WMS-Server

geographika geographika at gmail.com
Sun Feb 14 15:18:53 EST 2010


Perhaps the INCLUDE directive could be used in your mapfile to point to different files containing LAYER definitions. The included files themselves could be modified rather than the overall mapfile.

http://mapserver.org/mapfile/Include.html

As I understand it every WMS request causes the mapfile to be reparsed each time, so any changes to the included file would be immediate. This may also get round any problems with file locks, although I'm not certain.

MAP
  NAME "include_mapfile"
  EXTENT 0 0 500 500
  SIZE 250 250

  INCLUDE "myLayers1.layers"
  INCLUDE "specialLayer.layer"
  etc..

Regards,

http://geographika.co.uk


Stephan Holl wrote:
> There are some questions open, perhaps you can give us some hints here:
> * What happens when the mapfile gets written and a WMS-request tries to
>    open/read the mapfile directly? It seems that there are no
>    flock-calls inside the mapserver-code for locking the mapfile.
> * Is there a better way to realize a robust way of modfying mapfiles on
>    the fly (without using mapscript).
>
>    


More information about the mapserver-dev mailing list