[GRASS-user] Export coordinates of 3D line feature into csv format?

Moritz Lennert mlennert at club.worldonline.be
Fri Jul 8 10:41:43 EDT 2011


On 08/07/11 15:57, Rainer M Krug wrote:
>
>
> On Fri, Jul 8, 2011 at 1:16 PM, Micha Silver <micha at arava.co.il
> <mailto:micha at arava.co.il>> wrote:
>
>     __
>     On Fri, 2011-07-08 at 11:19 +0200, Rainer M Krug wrote:
>>     Hi
>>
>>
>>     I would like to export a 3D line feature into a csv format, as in:
>>
>>
>>     x y z
>>     1 2 3
>>     .
>>     .
>>     .
>>
>>
>>     I am not interested in the attribute tab;e, as I need the
>>     coordinates incl z.
>>
>
>
> Hi Micha,
>
>     v.db.addcol <vectormap> col="x double precision, y double precision
>     z double predision"
>     Then put the values into those columns
>     v.to.db <vectormap> option=coor column="x,y,z"
>     Now export the attrib table as you did before.
>
>
> This does unfortunately not work, as I have a line feature and not a
> point feature - and I would like to extract the co-ordinates of
> all vertexes of each line. I need this data, as I have to do some
> analysis afterwards for which I need the z-co-ordinate of each vertex. I
> could convert the lines to points, but how do I know which ones belong
> to which line and in which order?

v.to.db option=start / option=end will give you the beginning and end 
coordinates of line beginnings and ends. AFAIK, this will not include 
each vertex of a line, only nodes.

Or you can use v.build option=dump, although the result will need some 
treatment to be usable.

Moritz


More information about the grass-user mailing list