[GRASS-user] Re: v.to.rast multiple points per pixel

Hamish hamish_b at yahoo.com
Tue Mar 23 07:08:59 EDT 2010


Gary wrote:
> ok, so
> 
> v.out.ascii input=BonesVect output=bones_temp.asc
>
> r.in.xyz input=bones_temp.asc output=BonesRast method=sum \
>    x=1 y=2 z=3
> 
> However i need to specify a column for x and y (z=Count
> column)
> 
> How do I create a new column in my database of x and y
> values? Is there an automatic way, I vaguely remember
> something about it v.report?

  v.out.ascii columns=

for example (spearfish dataset)
  v.out.ascii archsites column=str1

that also prints the attribute column data stored in the "str1"
column.

> Also I have never tried pipeing is it something like this:
> 
> v.out.ascii input=BonesVect output=bones_temp.asc |
>   r.in.xyz input=bones_temp.asc output=BonesRast method=sum
>      x=1 y=2 z=3

yes, but with the extra data column and you need to bypass
the intermediate output/input filenames. so for the spearfish
example it would look like:

g.region n= s= w= e= res=   # set up the wanted grid size first!

v.out.ascii archsites column=cat | r.in.xyz input=- \
  method=sum x=1 y=2 z=4 output=archsites.sum

here I used the numeric "cat" column as the data value. run
v.out.ascii without the pipe to check which column you need
to pick. nb spearfish's archsites map is not very interesting
as it only has 25 points in it to begin with.

Micha:
> The z= parameter is for altitude values. I'm not sure this is > relevant in this case.

it doesn't have to be elevation. the z= data can represent anything numeric. from the help page:

        x   Column number of x coordinates in input file (first column is 1)
            default: 1
        y   Column number of y coordinates in input file
            default: 2
        z   Column number of data values in input file
            default: 3


regards,
Hamish



      


More information about the grass-user mailing list