Appendix B: Creating MapServer CLASS definitions from ArcView legends
The Gix Export Tool can help you create the CLASS sections of your MapFile from an ESRI ArcView 3.x .apr file. This tool converts ESRI ArcView 3.x (NOT ArcMap) projects to common open source alternatives including a MapServer MapFile. (Please note that this tool has only been used to convert simple symbology e.g. geology polygons symbolized by a solid colour according to its lithology value. Its ability to convert more complex symbology has not been tested.) Download the Gix Export Tool . Run the executable and follow the instructions to install the tool as an ArcView 3.x extension. Having installed the Gix Export Tool, create or open an ArcView project containing your symbolized data.
Load the Gix Export Tool Extension (File — Extensions, tick required extension, click OK).
Complete the following steps to convert your project to a MapServer MapFile.
- Select View — Export View.
- The first screen asks you to select your output file format — choose MapServer MapFile (.map) and click next.
- The next screen asks you to select a version (choose default) and output file. The output file generated will be a temporary file from which you will cut the CLASS components and paste them into the master MapFile you have been creating elsewhere. Select a location for your output file and click next.
- The next screen asks for details of the main and reference map. You won’t use these sections so accept the defaults and click next.
- The next screen asks for details of the legend. Again, you won’t use these sections so accept the defaults and click next.
- The next screen asks for details of the scale bar. Again, you won’t use these sections so accept the defaults and click next.
- The next screen asks for details of the OGC metadata. Again, you won’t use these sections so accept the defaults and click next.
- The next screen asks for details of final options. Again, you won’t use these sections so accept the defaults.
- Click Finish to create your mapfile.
Open up the MapFile you created in a text editor and complete the following steps for each layer in your mapfile:
- Navigate to the line beginning CLASSITEM
- Highlight from here down to the END #CLASS line associated with that layer
- Copy and paste the selected lines to an empty text file
- Delete all TEMPLATE ‘ template.html’ lines (one for each class)
- Paste the remaining content into your master mapFile within the section for the layer you are dealing with. A good position is after the END line which closes the METADATA for that layer.
If your symbolization in ArcView had polygon boundaries you will need to remove these from the MapServer symbolization. This may be easier to do by deleting all the 'OUTLINECOLOR' lines from the generated mapfile than by altering your ArcView symbolization.
Section last modified : 19 January 2010.