Plugins delimited text

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

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

Delimited Text Plugin

The Delimited Text plugin allows you to load a delimited text file as a layer in QGIS. <P> Requirements <P> To view a delimited text file as layer, the text file must contain: <P>

  1. A delimited header row of field names. This must be the first line in the text file.
  2. The header row must contain an X and Y field. These fields can have any name.
  3. The x and y coordinates must be specified as a number. The coordinate system is not important.

<P> As an example of a valid text file we import the elevation point data file elevp.csv coming with the QGIS sample dataset (See Section #label_sampledata"):

<P>

 
X;Y;ELEV
-300120;7689960;13
-654360;7562040;52
1640;7512840;3
[...]

<P> Some items of note about the text file are:

<P>

  1. The example text file uses as delimiter. Any character can be used to delimit the fields.
  2. The first row is the header row. It contains the fields X, Y and ELEV.
  3. No quotes (") are used to delimit text fields.
  4. The x coordinates are contained in the X field.
  5. The y coordinates are contained in the Y field.

<P> Using the Plugin
To use the plugin you must first enable it as described in Section #sec:managing_plugins".

<P> Click the new toolbar icon delimited_textAdd Delimited Text Layer to open the Delimited Text dialog as shown in Figure <A HREF="#fig:delim_text_plugin_dialog">44</A>.

<P>

<A NAME="fig:delim_text_plugin_dialog"></A><A NAME="24"></A>
Figure: Delimited Text Dialog

[clip=true, width=9cm]delimited_text_dialog

<P> First select the file (e.g., qgis_sample_data/csv/elevp.csv) to import by clicking on the Browse button. Once the file is selected, the plugin attempts to parse the file using the last used delimiter, in this case a semi-colon (). To properly parse the file, it is important to select the correct delimiter. To change the delimiter to tab use \t (this is a regular expression for the tab character). After changing the delimiter, click Parse.

<P> Once you have parsed the file, choose the X and Y fields from the drop down lists and enter a Layer name (e.g., elevp ) as shown in Figure <A HREF="#fig:delim_text_plugin_dialog">44</A>. To add the layer to the map, click

Add Layer. The delimited text file now behaves as any other map layer in QGIS.