[GRASS-user] v.in.ascii - put1 of 4 columns to 3D point file attribute

M S mseibel at gmail.com
Wed Apr 9 11:05:35 EDT 2008


Sorry if the problem was unclear.  I would like to:
1) use the first 3 columns to create the 3D point geometry, but not put XYZ
values into the table
2) use the 4th column to add a "code" attribute to the table, and populate
with values from the 4th column of the ascii file
3) have the "cat" field automagically populated.
4) the desired end result is a 3D point file, with only "cat" and "code"
attributes in the table.

Perhaps what I'm trying to accomplish is not necessary, but I'm trying to
keep the DB table small due to the volume of points.  For now I'm just
working with 10 of the 5 million.

Here's the file head, there's no header (although it is X,Y,Z,<some int
number>)
480354.49,1539756.39,16.59,196

the v.in.ascii was:
v.in.ascii -z -n input=57697.txt output=lidar57697 format=point fs=, skip=0
{columns=code int} x=1 y=2 z=3 cat=0

which yeilds:
maximum input row length: 43
maximum number of columns: 4
minimum number of columns: 4
column: 1 type: double
column: 2 type: double
column: 3 type: double
column: 4 type: integer

<ERROR> number of columns defined (1) does not match number of columns (4)
in input.


Mark

On Wed, Apr 9, 2008 at 10:21 AM, Moritz Lennert <
mlennert at club.worldonline.be> wrote:

> On 09/04/08 14:55, M S wrote:
>
>  I would like to import the XYZ to build the geometry for 3D points, and
> > have only "Cat" and "Code" in the attribute table.  ("Code" being a column
> > name for the 4th column in the input ASCII).  I cant seem to find the
> > combination of column definitions and other parameters to achieve this.  One
> > option seems to import them all as "x double, y double, z double, code int",
> > and then after the import, drop the x,y,z columns.  Is it possible to put
> > the first 3 ASCII column values to the geometry, and use only the last
> > column as an attribute?
> >
>
> I'm not sure I really understand your problem. Maybe you could send us the
> layout of your file (head -2) and the v.in.ascii command you tried.
>
> You need to specify the _column number_ of your X,Y and Z columns with the
> x=, y= and z= parameters, the _column number_ of you cat column with the
> cat= parameter, and the attribute columns with the columns= parameter.
>
> So if I understand your file correctly it would be something like this:
>
> v.in.ascii -z [...] x=1 y=2 z=3 cat=4 columns="code int"
>
> You might also want to use the -b flag, as topology building can lead to
> overload if the input data file is too large.
>
> Moritz
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20080409/b84da8ae/attachment.html


More information about the grass-user mailing list