|< Day Day Up >|
4.2. Walkthrough of the Main
The MapServer CGI executable acts as a middle man between the mapping data files and the web server program requesting the map. The requests are passed in the form of CGI parameters from the web server to MapServer. The images that are created by MapServer are then fed back to the web server and, ultimately, to the user's web browser. More on the MapServer executable and how to install it is discussed later in this chapter.
Web Server Considerations
MapServer depends on the web server; because of this, you need to remember how important the web server is. MapServer application developers need to be aware of changes in web server development that might affect their applications. This book doesn't describe how to install or manage a web server, but other books are available. O'Reilly has web server management and web development titles available at http://web.oreilly.com/. Two of the hottest web server topics are managing large
In general, MapServer application developers should rely on web server managers to help make sure the applications are secure and can handle the load.
The focus of this chapter is on using MapServer to create a map image. MapServer can also create scale bars, legends, and reference/key maps for your application, as discussed in Chapters 10 and 11.
MapServer is like an engine that requires fuel to run and a fuel delivery system to get the fuel to the engine. The MapServer program needs to know what map layers to draw, how to draw them, and where the source data is located. The data is the fuel, and the map file—also known as the mapping file or .map file—serves as the delivery system. The map file is a text configuration file that lists the settings for drawing and interacting with the map. It includes information about what data layers to draw, where the geographic focus of the map is, what projection system is being used, and which output image format to use, and it sets the way the legends and scale bars are drawn. An extremely simple version of a map file is shown in Example 4-1.
MAP SIZE 600 300 EXTENT -180 -90 180 90 LAYER NAME countries TYPE POLYGON STATUS DEFAULT DATA countries.shp CLASS OUTLINECOLOR 100 100 100 END END END
When a request comes to a MapServer application, the request must specify what map file to use. Then MapServer creates the map based on the settings in the map file. This makes the map file the central piece of any MapServer application. Map files are covered in greater detail in Chapter 10, where the process of creating a MapServer application is discussed.
If the map file is the fuel delivery system, the data sources are the fuel. MapServer can use a vast array of data sources to create maps. Out-of-the-box support covers the most common formats. Optional data access add-ons
MapServer can also use the OGC web specifications to access and share data across the Internet. Map layers can be
While the map file is the central part of any MapServer application, the map image that is generated is usually what the end user is after. After all the layers are
The map isn't the only image that can be created. Scale bars, graphic legends and reference maps can also be part of a MapServer application. These are handled in a similar manner as the map image. Chapters 10 and 11 show examples that use these.
|< Day Day Up >|