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:
MAXSIZE deprecated since 6.0
MINSIZE deprecated since 6.0
OUTLINECOLOR deprecated since 6.0
SIZE deprecated since 6.0
MAXSCALE - not in docs
Remove direct styling in
CLASS blocks, rather than in
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.