[GRASS-user] points to lines

Moritz Lennert mlennert at club.worldonline.be
Thu Mar 8 17:17:26 EST 2007


On 08/03/07 18:00, Jorge Echeverri wrote:
> Hi,
> 
> I have to admit that I am an absolute beginner in GRASS.
> 
> I need to import vector data from a text-file with this format:
> x-begin,y-begin,x-end,y-end
> 
> Any suggestion?

v.in.ascii

You will have to transform your data (e.g. with awk) to fit the standard 
format. Something like this (untested) should work:

awk -F"," 'BEGIN{i=0} {i++;print "L 2 1";print $1,$2,i;i++;print 
$3,$4,i;print "1"}' YourFile | v.in.ascii -n format=standard 
out=YourMapName fs=" "

See the v.in.ascii man page for details.

Moritz




More information about the grass-user mailing list