「Plugins delimited text」の版間の差分

提供: OSGeo.JP Wiki
移動: 案内検索
(ページの作成: <H2> Delimited Text Plugin </H2> <P> 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 …)
 
 
(同じ利用者による、間の1版が非表示)
行1: 行1:
<H2>
+
=== Delimited Text Plugin ===
Delimited Text Plugin
+
<span id='label_dltext'></span>     
</H2>     
+
  
<P>
 
 
The Delimited Text plugin allows you to load a delimited text file as a layer in QGIS.  
 
The Delimited Text plugin allows you to load a delimited text file as a layer in QGIS.  
  
<P>
+
===== Requirements =====
Requirements
+
  
<P>
 
 
To view a delimited text file as layer, the text file must contain:
 
To view a delimited text file as layer, the text file must contain:
  
<P>
+
<ol>     
 +
<li>A delimited header row of field names. This must be the first line in the text file.
 +
<li>The header row must contain an X and Y field. These fields can have any name.
 +
<li>The x and y coordinates must be specified as a number. The coordinate system is not important.
 +
</ol>
  
<OL>
 
<LI>A delimited header row of field names. This must be the first line in the text file.
 
</LI>
 
<LI>The header row must contain an X and Y field. These fields can have any name.
 
</LI>
 
<LI>The x and y coordinates must be specified as a number. The coordinate system is not important.
 
</LI>
 
</OL>
 
 
<P>
 
 
As an example of a valid text file we import the elevation point data file  
 
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&nbsp;[[#label_sampledata]]"):
+
{{Template:FileName|elevp.csv}} coming with the QGIS sample dataset (See Section~[[label_sampledata]]):
  
<P>
+
<pre>  
<PRE>  
+
 
X;Y;ELEV
 
X;Y;ELEV
 
-300120;7689960;13
 
-300120;7689960;13
行34: 行23:
 
1640;7512840;3
 
1640;7512840;3
 
[...]
 
[...]
</PRE>
+
</pre>
  
<P>
 
 
Some items of note about the text file are:
 
Some items of note about the text file are:
  
<P>
+
<ol>
 
+
<li>The example text file uses ; as delimiter. Any character can be used to delimit the fields.
<OL>
+
<li>The first row is the header row. It contains the fields X, Y and ELEV.
<LI>The example text file uses <SPAN CLASS="MATH"></SPAN> as delimiter. Any character can be used to delimit the fields.
+
<li>No quotes (") are used to delimit text fields.
</LI>
+
<li>The x coordinates are contained in the ''X'' field.
<LI>The first row is the header row. It contains the fields X, Y and ELEV.
+
<li>The y coordinates are contained in the ''Y'' field.
</LI>
+
</ol>
<LI>No quotes (<TT>"</TT>) are used to delimit text fields.
+
</LI>
+
<LI>The x coordinates are contained in the <EM>X</EM> field.
+
</LI>
+
<LI>The y coordinates are contained in the <EM>Y</EM> field.
+
</LI>
+
</OL>
+
 
+
<P>
+
Using the Plugin<BR>
+
To use the plugin you must first enable it as described in Section [[#sec:managing_plugins]]".
+
  
<P>
+
===== Using the Plugin =====
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>.
+
To use the plugin you must first enable it as described in Section [[sec:managing_plugins]].
  
<P>
+
Click the new toolbar icon {{Template:ToolBtnTwo|delimited_text|Add Delimited Text Layer}} to open the Delimited Text dialog as shown in Figure [[#fig:delim_text_plugin_dialog|42]].
  
<DIV ALIGN="CENTER"><A NAME="fig:delim_text_plugin_dialog"></A><A NAME="24"></A>
+
<table align='center'>
<TABLE>
+
<caption>'''図 42:''' Delimited Text Dialog {{Template:Nix}}</caption>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure:</STRONG>
+
<tr><td><span id='fig:delim_text_plugin_dialog'></span>
Delimited Text Dialog </CAPTION>
+
  [[File:delimited_text_dialog.png|340px]]</td></tr></table>
<TR><TD>
+
<DIV ALIGN="CENTER">
+
</DIV>
+
<P></P>
+
<DIV ALIGN="CENTER">  [clip=true, width=9cm]delimited_text_dialog
+
 
+
</DIV></TD></TR>
+
</TABLE>
+
</DIV>
+
  
<P>
+
First select the file (e.g., {{Template:FileName|qgis_sample_data/csv/elevp.csv}}) to import by clicking  
First select the file (e.g., qgis_sample_data/csv/elevp.csv) to import by clicking  
+
on the {{Template:Button|Browse}} button. Once the file is selected, the plugin attempts to parse the file  
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  
using the last used delimiter, in this case a semi-colon (<SPAN CLASS="MATH"></SPAN>). To properly parse the file, it  
+
 
is important to select the correct delimiter. To change the delimiter to tab use  
 
is important to select the correct delimiter. To change the delimiter to tab use  
 
\t (this is a regular expression for the tab character).
 
\t (this is a regular expression for the tab character).
After changing the delimiter, click Parse.
+
After changing the delimiter, click {{Template:Button|Parse}}.
  
<P>
 
 
Once you have parsed the file, choose the X and Y fields from the drop down lists and  
 
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  
+
enter a Layer name (e.g., {{Template:FileName|elevp}} ) as shown in Figure  
<A HREF="#fig:delim_text_plugin_dialog">44</A>. To add the layer to the map, click  
+
[[#fig:delim_text_plugin_dialog|42]]. To add the layer to the map, click  
Add Layer. The delimited text file now behaves as any other map layer in QGIS.
+
{{Template:Button|Add Layer}}. The delimited text file now behaves as any other map layer in QGIS.

2009年10月5日 (月) 02:15時点における最新版

Delimited Text Plugin

The Delimited Text plugin allows you to load a delimited text file as a layer in QGIS.

Requirements

To view a delimited text file as layer, the text file must contain:

  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.

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):

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

Some items of note about the text file are:

  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.
Using the Plugin

To use the plugin you must first enable it as described in Section sec:managing_plugins.

Click the new toolbar icon Delimited text.png Add Delimited Text Layer to open the Delimited Text dialog as shown in Figure 42.

図 42: Delimited Text Dialog Nix.png
Delimited text dialog.png

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.

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 42. To add the layer to the map, click Add Layer. The delimited text file now behaves as any other map layer in QGIS.