@@ -159,10 +159,10 @@ is invalid if it does not have capture groups. As an example this can be used a
159159unintuitive) means of loading data with fixed width fields. For example the
160160expression
161161<pre>
162- ^(.{5})(.{10})(.{20})(.{20}).*
162+ ^(.{5})(.{10})(.{20})(.{20})
163163</pre>
164164<p>will extract four fields of widths 5, 10, 20, and 20 characters from each line.
165- Lines less than 45 characters long will be discarded.
165+ Lines less than 55 characters long will be discarded.
166166</p>
167167
168168
@@ -210,10 +210,10 @@ are interpreted.
210210
211211<h4><a name="example">Example of a text file with X,Y point coordinates</a></h4>
212212<pre>
213- X;Y;ELEV<br />
214- -300120;7689960;13<br />
215- -654360;7562040;52<br />
216- 1640;7512840;3<br />
213+ X;Y;ELEV
214+ -300120;7689960;13
215+ -654360;7562040;52
216+ 1640;7512840;3
217217</pre>
218218<p>This file:</p>
219219<ul>
@@ -224,12 +224,12 @@ X;Y;ELEV<br />
224224</ul>
225225<h4><a name="wkt_example">Example of a text file with WKT geometries</a></h4>
226226<pre>
227- id|wkt<br />
228- 1|POINT(172.0702250 -43.6031036)<br />
229- 2|POINT(172.0702250 -43.6031036)<br />
230- 3|POINT(172.1543206 -43.5731302)<br />
231- 4|POINT(171.9282585 -43.5493308)<br />
232- 5|POINT(171.8827359 -43.5875983)<br />
227+ id|wkt
228+ 1|POINT(172.0702250 -43.6031036)
229+ 2|POINT(172.0702250 -43.6031036)
230+ 3|POINT(172.1543206 -43.5731302)
231+ 4|POINT(171.9282585 -43.5493308)
232+ 5|POINT(171.8827359 -43.5875983)
233233</pre>
234234<p>This file:</p>
235235<ul>
@@ -243,20 +243,20 @@ id|wkt<br />
243243The pattern is:
244244</p>
245245<pre>
246- from PyQt4.QtCore import QUrl, QString<br />
247- from qgis.core import QgsVectorLayer, QgsMapLayerRegistry<br />
248- <br />
249- # Define the data source<br />
250- filename="test.csv"<br />
251- uri=QUrl.fromLocalFile(filename)<br />
252- uri.addQueryItem("type","csv")<br />
253- uri.addQueryItem("delimiter","|")<br />
254- uri.addQueryItem("wktField","wkt")<br />
255- # ... other delimited text parameters<br />
256- layer=QgsVectorLayer(QString(uri.toEncoded()),"Test CSV layer","delimitedtext")<br />
257- # Add the layer to the map<br />
258- if layer.isValid():<br />
259- QgsMapLayerRegistry.instance().addMapLayer( layer )<br />
246+ from PyQt4.QtCore import QUrl, QString
247+ from qgis.core import QgsVectorLayer, QgsMapLayerRegistry
248+
249+ # Define the data source
250+ filename="test.csv"
251+ uri=QUrl.fromLocalFile(filename)
252+ uri.addQueryItem("type","csv")
253+ uri.addQueryItem("delimiter","|")
254+ uri.addQueryItem("wktField","wkt")
255+ # ... other delimited text parameters
256+ layer=QgsVectorLayer(QString(uri.toEncoded()),"Test CSV layer","delimitedtext")
257+ # Add the layer to the map
258+ if layer.isValid():
259+ QgsMapLayerRegistry.instance().addMapLayer( layer )
260260</pre>
261261<p>This could be used to load the second example file above.</p>
262262<p>The configuration of the delimited text layer is defined by adding query items to the uri.
0 commit comments