Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to run the following test CSV through the Delimited Text plugin as WKT data:

oid,Line
1,LINESTRING((45.554194 -122.686101, 45.433001 -122.762632))
2,LINESTRING((45.432505 -122.598327, 45.423743 -122.592932))
3,LINESTRING((45.285959 -122.333998, 45.423743 -122.592932))
4,LINESTRING((45.548994 -122.514218, 45.519204 -122.679675))
5,LINESTRING((45.491189 -122.873493, 45.433001 -122.762632))
6,LINESTRING((45.380535 -122.743911, 45.397011 -122.79874))
7,LINESTRING((45.347019 -122.350363, 45.423743 -122.592932))
8,LINESTRING((45.582386 -122.689115, 45.536485 -122.65859))
9,LINESTRING((45.430841 -122.782667, 45.380535 -122.743911))

All I'm getting for my trouble is this error:

The layer file:///$PATHTOFILE?delimiter=%5B,%5D&delimiterType=regexp&wktField=Line is not a valid layer and can not be added to the map

I have to be missing something simple here, but I have no idea what it is, and Google hasn't been helpful. I'm using QGIS 1.8.0-Lisboa.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

There are two possibilities here (see http://en.wikipedia.org/wiki/Well-known_text for more possibilities):

  1. LineString - LINESTRING (30 10, 10 30, 40 40)
  2. MultiLineString - MULTILINESTRING ((10 10, 20 20, 10 40), (40 40, 30 30, 40 20, 30 10))

Currently you have LINESTRING and (( which is wrong.

UPDATE There is also a problem with the commas as Jason says, I managed to get the following to import (once I changed the delimiter to ;):

oid;Line
1;LINESTRING(45.554194 -122.686101, 45.433001 -122.762632)
2;LINESTRING(45.432505 -122.598327, 45.423743 -122.592932)
3;LINESTRING(45.285959 -122.333998, 45.423743 -122.592932)
4;LINESTRING(45.548994 -122.514218, 45.519204 -122.679675)
5;LINESTRING(45.491189 -122.873493, 45.433001 -122.762632)
6;LINESTRING(45.380535 -122.743911, 45.397011 -122.79874)
7;LINESTRING(45.347019 -122.350363, 45.423743 -122.592932)
8;LINESTRING(45.582386 -122.689115, 45.536485 -122.65859)
9;LINESTRING(45.430841 -122.782667, 45.380535 -122.743911)
share|improve this answer
    
Also, won't those commas in the LINESTRING trip it up and split it into multiple columns? Shouldn't the WKT be quoted? –  Jason Scheirer Sep 27 '12 at 9:47
    
Make sure you view the file in a text editor, not a spreadsheet program. I use Notepad++ to Replace All and I remove the " s –  Willy Sep 27 '12 at 20:36
    
The (( was an artifact from some other things I tried. I think the main issue I was having is indeed the commas. Thanks! –  Pliny Oct 1 '12 at 17:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.