[GRASSLIST:4043] Re: sites handling specialist ?
Crudeli
crudeli at mail.nauta.it
Sat Jul 6 08:18:29 EDT 2002
>Dear list,
>
>Pardon me to insist with this issue. Does any of you know how to append
>attributes to sites coverages?
>I have two raster coverage, one providing the elevation of the sites, the
>second providing the precision of their elevation. I would like to use the
>precision to tune the smoothing parameter of the RST. I understand that I
>have to have one coverage containing both field in order to proceed to the
>interpolation. Is this correct?
>If the conversion of raster to site format can only deal with one field at a
>time, how can I merge two sites coverages later on? It ought to be
>possible... surely (???)
>
>By the way, I know I could simply create two ascii files and mess with them
>manually but is there a more elegant way?
sure: you can use the shell "join" command:
if your format is
file1: x y z
file2: x y precision
and assuming that the (x,y) in the first file are the same as the
ones in the second file,
try
_______________________________________________
# the following is for avoiding mistakes between two sites
#with the same x or y
cat file1 | awk '{print $1"_"$2, $3 }' |sort>file1.xy
cat file2 | awk '{print $1"_"$2, $3 }' |sort>file2.xy
join file1.xy file2.xy | tr "_" " " > file.xyzP
s.in.ascii fs=space file.xyzP
rm -f file1.xy, file2.xy
_______________________________________________
you then have to set the proper "d" switch to the s.in.ascii.
BTW, if you don't have the original ascii files (file1 and file2),
used to interpolate your rasters, or their (x,y) are not
corresponding, you can always use s.sample on both maps with the same
sites. For istance:
_______________________________________________
s.sample sitesfile XYZ_raster> file1
s.sample sitesfile Precision_raster> file2
_______________________________________________
Hope this helps,
RafDouglas CTC
--
__________________________________________
RafDouglas Candidi Tommasi Crudeli
ct at ehleng.com
"To know, to will, to dare, to be silent."
More information about the grass-user
mailing list