[GRASSLIST:6046] Re: XYZ input in Grass6?
Sander Oom
slist at oomvanlieshout.net
Mon Mar 7 12:43:37 EST 2005
Hi Lawrence,
It would be helpful if you told us how you did it previously! That could
point towards possible solutions.
Anyway, I recently had to do something similar myself and came up with
the code below. You will have to hack it for your won purpose!
Good luck,
Sander.
###########################
## set correct resolution!!
## resolution should be 10min = 10/60 = 0.1666666666666667
g.region res=0.166666666667
# grass does not like column names!
fileName=/data1/gisdata/southafrica/climate/cru/cru_10min_tmp_SA.txt
echo $fileName
g.remove vect=cru_tmp
cat $fileName | v.in.ascii fs=',' out=cru_tmp x=2 y=3 cat=1
+ columns='cat int, x double, y double, tmp1 double, tmp2 double,
+ tmp3 double, tmp4 double, tmp5 double, tmp6 double, tmp7 double,
+ tmp8 double, tmp9 double, tmp10 double, tmp11 double, tmp12 double'
db.describe -c table=cru_tmp
## convert vector points to raster
vectIn=cru_tmp
for a in $( seq 1 12 ) ; do
rastOut=cru_tmp${a:-6} # use 6 if a is not declared
colName=tmp${a:-6}
g.remove rast=$rastOut
v.to.rast input=$vectIn output=$rastOut col=$colName
r.describe $rastOut -r
## display
r.colors map=$rastOut color=rainbow
done
###########################
Lawrence Moran wrote:
> Having used s.in.ascii in 53 and 54, to import files containing lat long
> depth/height, I'm having difficulty achieving the same in 6.0.0beta (OSX).
>
> Does anybody know how to import such files in Grass 6?
>
> Thanks,
>
> Lawrence
>
>
--
--------------------------------------------
Dr. Sander P. Oom
Animal, Plant and Environmental Sciences,
University of the Witwatersrand
Private Bag 3, Wits 2050, South Africa
Tel (work) +27 (0)11 717 64 04
Tel (home) +27 (0)18 297 44 51
Fax +27 (0)18 299 24 64
Email sander at oomvanlieshout.net
Web www.oomvanlieshout.net/sander
---------------------------------------------
More information about the grass-user
mailing list