[GRASS-user] Create a line from 2 points

Hamish hamish_b at yahoo.com
Sun Feb 7 22:42:57 EST 2010


Hamish:
> > have a look at the brand new script "v.in.lines"

Alex:
> I noticed that functions is only listed in 6.5. Will it work against
> 6.4.

Yes, I just haven't backported it because it is so new & untested.

It is just a more obvious wrapper script around v.in.mapgen though, which
has been in GRASS for more than a decade.


> It seems like it should work even though there seems to be a little
> back bending to have to export and the import again.

There has to be a little, points to lines is a jumble without telling it
how to order the points, so it always needs some help from a human.


> I'll probably just prepare it in SQL to begin with. Would v.in.ascii
> work on an sqlite table or does it have to be a text file?

v.in.ascii wants a text file.
note the two modes: as points or as a "standard" grass ascii vector format.
Lines, areas, etc. need to be imported in "standard" mode.

There is v.in.db for direct import from a DB, but if only works for points.


Maybe the new OGR Spatialite driver + v.in.ogr helps if lines are already
in SQLite?


if you want to import as a line you will have to use some awk magic or
similar to create the "standard" grass ascii format. See the v.in.lines,
v.in.mapgen, v.in.gps*, and (simplest) v.in.mbsys_fnv addon script for
examples.


Hamish



      


More information about the grass-user mailing list