|
|
行1: |
行1: |
− | <H3>
| + | --[[利用者:Sanak|Sanak]] 2009年10月5日 (月) 13:54 (UTC)このページは削除予定です。 |
− | Testing the Map File
| + | |
− | </H3>
| + | |
− | | + | |
− | <P>
| + | |
− | 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>
| + | |
− | | + | |
− | <UL>
| + | |
− | <LI>Open a terminal window
| + | |
− | </LI>
| + | |
− | <LI>If you didn't save your map file in your home directory, change to
| + | |
− | the folder where you saved it.
| + | |
− | </LI>
| + | |
− | <LI>Run shp2img -m qgisproject.map -o mapserver_test.png and
| + | |
− | display the image
| + | |
− | </LI>
| + | |
− | </UL>
| + | |
− | | + | |
− | <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>
| + | |
− | | + | |
− | <DIV ALIGN="CENTER"><A NAME="fig:mapserver_export_test"></A><A NAME="74"></A>
| + | |
− | <TABLE>
| + | |
− | <CAPTION ALIGN="BOTTOM"><STRONG>Figure:</STRONG>
| + | |
− | Test PNG created by shp2img with all MapServer Export layers </CAPTION>
| + | |
− | <TR><TD>
| + | |
− | <DIV ALIGN="CENTER">
| + | |
− | </DIV>
| + | |
− | <P></P>
| + | |
− | <DIV ALIGN="CENTER"> [clip=true, width=12cm]mapserver_export_test
| + | |
− | | + | |
− | </DIV></TD></TR>
| + | |
− | </TABLE>
| + | |
− | </DIV>
| + | |
− | | + | |
− | <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.
| + | |