[GRASS-user] Importing lines from database

Hamish hamish_b at yahoo.com
Mon Jan 14 22:13:34 EST 2008


Richard Chirgwin wrote:      
> I have a database containing pairs of points, each with lat/long.
> For convenience (there are lots of points) I would like to use this
> (and the distance between the points if necessary) to create a vector
> map containing lines joining the points. This way, I don't have to
> hand-draw a couple of thousand lines.I can't see any support in the
> database import ( v.in.db ) to do this- is there some way to create
> lines directly from my database?    

Hamish:
> You will have to do 'v.in.ascii -n format=standard'
> L n
>  x1 y1
>  x2 y2 
>  ... 
>  xn yn

Richard:
> The file looks like this:
> L  1
> 153.125 -30.2341
> 153.108 -30.2577
> L  2
> 153.125 -30.2341
> 153.108 -30.2577
>
> - and the command like this:
> v.in.ascii -n input=lines2.txt output=testlines format=standard
>
> But it's failing:
> Error reading ASCII file: (unknown type) [153.108 -30.2577]

The number after 'L' is number of vertices which follow, not the line
cat number. See the help page for how to add that.

"unknown type" is referring to an e.g. "L" for Line feature. After
reading 1 vertex it is then looking for the next feature type and sees
a coordinate instead.


Hamish



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 




More information about the grass-user mailing list