10.1. MapServer Utilities

 < Day Day Up > 

MapServer comes with much more than the standard mapserv executable file. The following programs are compiled at the same time as the mapserv file and are usually included in any MapServer installation package. MapServer is more than just a web mapping program. To demonstrate this, the chapter begins with an introduction to some command-line tools. They can be used as standalone applications for making maps without a web server. Details about each program are included.


legend

Creates a graphic image of a legend based on the symbols used to draw layers specified in a map file.


scalebar

Produces a graphic image of a scalebar based on the options in a map file, using the map extent as set in the map file.


shp2img

Produces a map image based on a map file. Map extents and desired layers can be set. The options are robust enough that a simple desktop custom application could use this tool to create maps. Similar to shp2pdf, which outputs a PDF rather than just an image.


shp2pdf

Produces an output PDF file that includes a map based on the input map file. This requires that MapServer was compiled with PDF support and has similar syntax as shp2img.


shptree

Adds an index (quad-tree based) to a shapefile that can improve performance when creating maps from large shapefiles. More information about the different options can be obtained from the mailing list archives or online documentation, but are outside the scope of this chapter.


tile4ms

Creates an overview shapefile that points to the location of individual files and their extent rectangles. This output shapefile can be used by MapServer to reference a large number of shapefiles (or other support data formats) that are in multiple pieces. This is helpful because you don't have to append them all together or add dozens of layers in the map file. Instead, the tile index tells MapServer what layers are available and where they are geographically. It is more efficient because the extent rectangles are used as an index to find only those tiles of interest within the current map extent. It is recommended to also run shptree on the index that you create. ogrtindex and gdaltindex, part of the GDAL/OGR packages, are similar. These are highly recommended because they can index more than just shapefiles.


sortshp

Sorts a shapefile using a field in the table, rearranging the physical order of features in the file. This can be helpful when order is important for display or query optimization.

For historical reasons, the prefix shp is used for some of the programs. They were originally created to convert shapefiles into images. Now they take a MapServer map file and output an image. Therefore, in most cases the shp prefix is a misnomer because shapefiles may not actually be involved; MapServer can access dozens of different types of data.

     < 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