[GRASS-user] Re: v.to.rast multiple points per pixel
Micha Silver
micha at arava.co.il
Sat Mar 20 16:52:52 EDT 2010
Gary Nobles 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?
>
You do that with:
v.db.addcol BonesVect col="XCOORD double precision, YCOORD double precision"
then
v.to.db BonesVect opt=coor col=XCOORD,YCOORD
However you don't need this for v.out.ascii. It creates a text file of
the coordinates (+ any additional columns you specify )
> Also I have never tried pipeing is it something like this:
>
>
>
Not quite. The idea of piping is avoiding the intermediate file, so
v.out.ascii BonesVect | r.in.xyz input=- out=BonesRast method=sum
should do it. (The dash after input= means "read input from STDIN, thru
the pipe)
> 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
>
The z= parameter is for altitude values. I'm not sure this is relevant
in this case. By using the method=sum you should get a value in each
raster cell that represents a count of the number of points from the
BonesVect that fall in that cell.
Regards,
Micha
> Thanks again
>
> Gary
>
--
Micha Silver
Arava Development Co. +972-52-3665918
http://surfaces.co.il
More information about the grass-user
mailing list