3.3. MapServer

 < Day Day Up > 

MapServer is the primary open source web mapping tool used in this book. The main MapServer site is at http://mapserver.gis.umn.edu.

There are numerous reasons people decide to use MapServer. One is the ability to make their mapping information broadly accessible to others, particularly over the Internet. Many GIS and mapping analysts need to create custom mapping products for those they support or work for; MapServer makes it possible for users to create maps without needing particular tools installed or assistance from mapping analysts. This in turn reduces the pressure on specialized staff.

Others come to MapServer because it is one of few solutions available for those with diverse data formats. MapServer, through the use of libraries such as GDAL/OGR, can access various data formats without data conversion.

Figure 3-1. A raw Landsat satellite image being viewed with OpenEV


Consider that you could have a collection of 10 different sets of mapping data, all of which need to appear on the same map simultaneously without any of the data being converted from its native format. The native formats can include those used by different commercial vendors. ESRI shapefiles, Intergraph Microstation design files (DGN), MapInfo TAB files, and Oracle spatial databases can all be mapped together without conversion. Other nonproprietary formats can be used as well, including the OGC standards for Geography Markup Language (GML), Web Map Server (WMS), Web Feature Server (WFS), and PostGIS and other databases. The ability to have simultaneous access to diverse data formats on the fly without conversion makes MapServer one of the only options for those who can't (or won't) do a wholesale conversion to a specific format.

Figure 3-2. A Landsat satellite image being viewed with OpenEV and an equalization enhancement


3.3.1. Data Access and Performance

MapServer supports a variety of formats. Some are native to the MapServer executable, while others are accessed through the GDAL/OGR libraries. The latter approach is necessary for formats not programmed directly into MapServer. Access through the libraries adds an extra level of communication between MapServer and the data source itself (which can cause poor performance in some cases).

In general, formats supported natively by MapServer should run faster than those using GDAL/OGR. For example, the most basic format MapServer uses is the ESRI shapefile or GeoTiff image. OGR supports the U.S. Census TIGER file format. The performance difference between loading TIGER or shapefiles can be considerable. However, using GDAL/OGR may not be the problem. Further investigation shows that the data formats are often the bottleneck. If the data in a file is structured in a way that makes it difficult to access or requires numerous levels of interpretation, it affects map drawing speed.

The general rule of thumb for best performance is to use ESRI shapefile format or GeoTiff image format. Because gdal_translate and ogr2ogr can write into these formats, most source data can be translated using these tools. If you access data across a network, storing data in the PostGIS database may be the best option. Because PostGIS processes your queries for data directly on the server, only the desired results are sent back over the network. With file-based data, more data has to be passed around, even before MapServer decides which pieces it needs. Server-side processing in a PostGIS database can significantly improve the performance of MapServer applications.

Wholesale conversions aren't always possible, but when tweaking performance, these general rules may be helpful.

3.3.2. Portability

MapServer and its supporting tools are available for many hardware and operating systems. Furthermore, MapServer functionality can be accessed through a variety of programming language interfaces, making it possible to integrate MapServer functionality into custom programs. MapServer can be used in custom environments where other web mapping servers may not run.

Because MapServer is open source, developers can improve, fix, and customize the actual code behind MapServer and port it to new operating systems or platforms. In fact, if you require a new feature, a developer can be hired to add it, and everyone in the community can benefit from the work.

MapServer is primarily a viewing and mapping application; users access maps through a web browser or other Internet data sharing protocols. This allows for visual sharing of mapping information and real-time data sharing with other applications using the OGC specifications. MapServer can perform pseudo data conversion by reading in various formats and providing access to another server or application using common protocols. MapServer isn't an analysis tool, but it can present mapping information using different cartographic techniques to visualize the results.

     < Day Day Up > 


    Web Mapping
    Web Mapping Illustrated: Using Open Source GIS Toolkits
    ISBN: 0596008651
    EAN: 2147483647
    Year: 2005
    Pages: 138

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net