Testing the Map File

提供: OSGeo.JP Wiki
2009年8月18日 (火) 16:57時点におけるKayama (トーク | 投稿記録)による版

(差分) ←前の版 | 最新版 (差分) | 次の版→ (差分)
移動: 案内検索

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>

<A NAME="fig:mapserver_export_test"></A><A NAME="74"></A>
Figure: Test PNG created by shp2img with all MapServer Export layers

[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.