Creating the Map File

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

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

Creating the Map File

The tool msexport to export a QGIS project file to a MapServer map file is installed in your QGIS binary directory and can be used independently of QGIS. To use it from within QGIS, you need to enable the MapServer Export Plugin first using the Plugin Manager (see Section #sec:load_core_plugin). <P>

<A NAME="fig:mapserver_export_dialog"></A><A NAME="32"></A>
Figure: Export to MapServer Dialog

[clip=true, width=9cm]mapserver_export_dialog

<P>

Map file

Enter the name for the map file to be created. You can use the button at the right to browse for the directory where you want the map file created.
Qgis project file

Enter the full path to the QGIS project file (.qgs) you want to export. You can use the button at the right to browse for the QGIS project file.
Map Name

A name for the map. This name is prefixed to all images generated by the mapserver.
Map Width

Width of the output image in pixels.
Map Height

Height of the output image in pixels.
Map Units

Units of measure used for output
Image type

Format for the output image generated by MapServer
Web Template

Full path to the MapServer template file to be used with the map file
Web Header

Full path to the MapServer header file to be used with the map file
Web Footer

Full path to the MapServer footer file to be used with the map file

<P> Only the Map file and QGIS project file inputs are required to create a map file, however by omitting the other parameters, you may end up creating a non-functional map file, depending on your intended use. Although QGIS is good at creating a map file from your project file, it may require some tweaking to get the results you want. For this example, we will create a map file using the project file mapserverproject.qgs we just created (see Figure 59):

<P>

  1. Start the MapServer dialog (see Figure 59) by clicking the mapserver_exportMapServer Export icon in the toolbar menu.
  2. Enter the name (e.g., qgisproject.map) for your new map file.
  3. Browse and find the QGIS project file (e.g., mapserverproject.qgs) you previously saved.
  4. Enter a name (e.g., MyMap) for the map.
  5. Enter the width and height (e.g., 600 for the width and 400 for the height) for your output image.
  6. For this example, the layers are in meters, so we change the units to meters.
  7. Choose ``png for the image type.
  8. Click OK to generate the new map file qgisproject.map. QGIS displays the success of your efforts.

<P> You can view the map file in any text editor or visualizer. If you take a look, you'll notice that the export tool adds the metadata needed to enable our map file for WMS.

<P>