[GRASSLIST:1424] Re: s.to.vect

Paul Kelly paul-grass at stjohnspoint.co.uk
Tue Oct 7 09:14:16 EDT 2003


On Tue, 7 Oct 2003, Miha STAUT wrote:

> Hi all,
>
> I have not managed to successfully convert a site data file into a point
> vector file.
> I have done the following:
>
> s.to.vect in=linear.pop out=linear.pop,

Since you left out the 'cat' parameter, you experienced the default behaviour
which isn't very useful. The sites format is very extensible while the 5.0
vector format is not so you need to specify in detail which attribute from
the sites file you want attached to the vectors.

>
> but the category values the module assigned were not the same as in the
> sites file. Seems like it assigned a sequence.

>From the man page:
Field type  ("string",  "dim",  or  "decimal")  and
index  to  use  for  the  vector category value. By
default, the category number is used.  The type  is
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
The category number (or attribute number) will be an increasing sequential
number assigned to each site imported. What this is saying is that by default,
the category value will be the same as the category number. You need to
specifically say that you want the 1st decimal attribute in the sites file to
be the vector category value as follows:

s.to.vect in=linear.pop out=linear.pop cat=decimal,1

You have only one attribute in your sites file but you still need to say
that you want the first.

I would say that there are grounds for improving the default behaviour of
the program but then again it is possible to have a sites file without any
attributes, so maybe it is a good 'lowest common denominator' default.

Paul




More information about the grass-user mailing list