MS RFC 133: Mapfile Syntax Cleanup¶
- Last update
This RFC proposes removing deprecated Mapfile keywords and syntax as part of the 8.0 release. Keywords have been deprecated in previous MapServer releases for various reasons, and continuing to support them could cause confusion for new MapServer users.
There are a number of options for each keyword listed as deprecated.
Remove from parser
Remove all code paths and references
Remove from docs
Remove from all msautotests and examples
Reinstate the keyword
Remove deprecated reference from the docs
Leave as deprecated
Add DEBUG warnings if used, aiming to remove in a future MapServer 9.0
Note this RFC is a first draft and aims to set out options to discuss on the MapServer dev mailing list.
In order to help users upgrade Mapfiles, version validation has been added to the Python mappyfile project. The online validator is currently hosted at http://mappyfile.geographika.net/ but could be hosted on the mapserver.org domain if desired.
The mappyfile project can also be run locally on the command-line to validate Mapfiles against specific versions of MapServer using the following command:
mappyfile validate C:\Code\mapserver\mapserver\msautotest\**\*.map --version=8.0
This will log any Mapfile syntax errors for the specified version in the following format:
class16.map (Line: 26 Column: 3) ERROR: Invalid value in CLASS - 'color' does not match any of the regexes: '^__[a-z]+__$'
Proposed Keyword Changes¶
The following Mapfile syntax changes are proposed.
Remove the following deprecated keywords. These were used to apply direct styling in
CLASS blocks, rather than in
BACKGROUNDCOLOR deprecated since 6.0
COLOR deprecated since 6.0
MAXSIZE deprecated since 6.0
MINSIZE deprecated since 6.0
OUTLINECOLOR deprecated since 6.0
SIZE deprecated since 6.0
SYMBOL deprecated since 6.0
MAXSCALE - not in docs
Also the following
OVERLAY shortcuts used for style 1 (undocumented):
Deprecated approach of styles directly in a CLASS:
LAYER NAME 'bdry_counpy2' TYPE LINE DATA '../query/data/bdry_counpy2.shp' STATUS DEFAULT CLASS COLOR 231 231 231 END END
New (since 2002) approach:
LAYER NAME 'bdry_counpy2' TYPE LINE DATA '../query/data/bdry_counpy2.shp' STATUS DEFAULT CLASS STYLE COLOR 231 231 231 END END END
Backward compatibility issues¶
Users will need to remove deprecated keywords from Mapfiles to use MapServer 8.0
Mapfile documentation will be updated to reflect any changes in the Mapfile syntax.
Ticket ID and reference¶
+1 from ThomasB, TomK, JeromeB, JukkaR, MikeS, EvenR, JeffM, SethG, SteveL