[mapserver-dev] Version conditionals in mapfile?

Stephen Woodbridge woodbri at swoodbridge.com
Mon Dec 23 13:06:34 PST 2013


Mark,

I created an issue to track this request.
https://github.com/mapserver/mapserver/issues/4832

I took some liberties with describing your request in the ticket, so 
feel free to add additional comments and watch the ticket if you are 
interested.

The obvious issue with the request is that adding this to trunk does not 
solve the problem because older versions of mapserver will not recognize 
the new syntax without being updated. But that said, it is essential 
that we start somewhere to help simplify the problem in the future.

Thank you for adding your input and comments.

-Steve W

On 12/23/2013 3:32 PM, Mark Volz wrote:
> Steve,
>
> Previously I had thought that something like your idea would be useful
> not necessarily as a way of managing different MapServer versions, but
> instead as a way to manage differences different environments such as a
> field laptop vs production server.
>
> For example:
>
> MAP
>
>                  #set the version near the top of the mapfile.
>
> VERSION  Laptop
>
>                  #VERSION ProductionServer
>
>>
> IF VERSION Laptop
>
>                  USE shapefiles as the data source
>
> END IF
>
> IF VERSION ProductionServer
>
>                  User PostGIS as the data source
>
> END IF
>
> I think your idea is be better, but I thought I would float this idea to
> see if you think it would be useful.
>
> Mark Volz, GISP
>
>  >
>
>  > ----------------------------------------------------------------------
>
>  >
>
>  > Message: 1
>
>  > Date: Sun, 22 Dec 2013 17:36:41 -0500
>
>  > From: Stephen Woodbridge <woodbri at swoodbridge.com
> <mailto:woodbri at swoodbridge.com>>
>
>  > To: mapserver-dev <mapserver-dev at lists.osgeo.org
> <mailto:mapserver-dev at lists.osgeo.org>>
>
>  > Subject: [mapserver-dev] Version conditionals in mapfile?
>
>  > Message-ID: <52B76979.6050807 at swoodbridge.com
> <mailto:52B76979.6050807 at swoodbridge.com>>
>
>  > Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>  >
>
>  > Hi all,
>
>  >
>
>  > I want to start a discussion on the possibility of adding version
> conditionals to
>
>  > mapfile to make it easier to support a single mapfile across multiple
> versions
>
>  > of mapserver.
>
>  >
>
>  > The idea would be to add some syntax that would allow something like:
>
>  >
>
>  > IF VERSION <op> <value>
>
>  >    ... use if true
>
>  > ENDIF
>
>  >
>
>  > or may be in short hand
>
>  >
>
>  > VERSION<op>(<value>) ... use if true to end of line or VERSION <op>
>
>  > <value>? ... use if true to end of line
>
>  >
>
>  > where <op> could be like GT|GE|EQ|LE|LT
>
>  > and <value> could be VVvv or VV.vv where VV is the major version and
> vv is
>
>  > the minor version and patch should not impact mapfile syntax so we could
>
>  > ignore them.
>
>  >
>
>  > Yes, this could be done using the C preprocessor or a script, but
> that does not
>
>  > solve the use case of having a single file that can be deployed and
> work for
>
>  > various versions of mapserver.
>
>  >
>
>  > In a production environment, you might have multiple mapfiles and
> multiple
>
>  > versions of mapserver. This would greatly simplify maintaining the
>
>  > production server or migrating applications between servers that
> might have
>
>  > different versions of mapserver installed.
>
>  >
>
>  > Why do I care? I'm in the process of upgrading a bunch of servers and I'm
>
>  > annoyed by the fact that I have 3 versions of mapserver that I need to
>
>  > support and I'm having to make three separate mapfiles that are 99% the
>
>  > same. Oh and this has the ripple effect that if you name these with a
> version
>
>  > number in the mapfile name, than all the applications that reference the
>
>  > mapfile have to know what version they are requesting maps from so they
>
>  > can specify the correct version named mapfile.
>
>  >
>
>  > Discussion:
>
>  >
>
>  > Does this sound like something that would be useful to our users?
>
>  >
>
>  > On the surface, this seems like it should be fairly easy to
> implemented in the
>
>  > parser, but I could be wrong.
>
>  >
>
>  > Any thoughts on this?
>
>  >
>
>  > -Steve W
>
>  >
>
>  >
>
>
>
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>



More information about the mapserver-dev mailing list