Testing the Map File
Testing the Map File
We can now test our work using the shp2img tool to create an image from the map file. The shp2img utility is part of MapServer and FWTools. To create an image from our map: <P>
- Open a terminal window
- If you didn't save your map file in your home directory, change to the folder where you saved it.
- Run shp2img -m qgisproject.map -o mapserver_test.png and display the image
<P> This creates a PNG with all the layers included in the QGIS project file. In addition, the extent of the PNG will be the same as when we saved the project. As you can see in Figure <A HREF="#fig:mapserver_export_test">60</A>, all information except the airport symbols are included.
<P>
[clip=true, width=12cm]mapserver_export_test
|
<P> If you plan to use the map file to serve WMS requests, you probably don't have to tweak anything. If you plan to use it with a mapping template or a custom interface, you may have a bit of manual work to do. To see how easy it is to go from QGIS to serving maps on the web, take a look at
Christopher Schmidt's 5 minute flash video. He used an older version of QGIS (version 0.8), but the demo applies equally well to newer versions.