[GRASSLIST:1129] Re: s.in.ascii | general site question
H B
hamish_nospam at yahoo.com
Sat Sep 6 07:03:39 EDT 2003
Hi Kevin,
> I am having some difficulties importing a sites file correctly... and
> maybe it is difficulty in understanding the principles behind the
> ascii file formats.
I hope that the help page for s.in.ascii (and links within) can be
helpful in this regard. If not, can you let us know what is missing?
http://grass.ibiblio.org/gdp/html_grass5/html/s.in.ascii.html
> I am attempting to import an ascii file with general form of:
> lon lat waveheight winddirection windspeed buoynumber
> (ex: -87.5 25.2 1.0 300 15 42001)
That should convert to something like:
(top lines are optional)
name|wavedata
desc|data from bouys
labels|lon lat waveheight winddirection windspeed buoynumber
form|||#%%%%
-87.5|25.2|#1 %1.0 %300 %15 %42001
-87.5|25.2|#2 %1.0 %300 %15 %42002
you can use category number (above #1,#2 -- normally just an arbitrary
sequential integer) for bouynumber if you want if all are integers.
-87.5|25.2|#42001 %1.0 %300 %15
or as a label:
-87.5|25.2|#1 %1.0 %300 %15 @"42001"
(quotes not needed for a simple string)
sed, awk, and vi can create such formated files quickly (and
scriptable) from a tab delimeted file once you figure out how to use
them.. ;)
I do this all the time and it works great.
> it is tab delimmeted, and imports with no problem. However, in
trying
> to use d.site.lables, it only allows me to use attr=double, which
adds
> on unnecessary zeros, making the labels worthless.
I've added a precision option to d.site.labels to set number of digits
after the decimal point for attr=double. This is in CVS and will not
appear in GRASS 5.0.3, but will be in GRASS 5.3+. You can always
download and recompile (gmake5 -i) the code yourself from CVS. It will
work with 5.0.2.
s.in.ascii could use some work..
good luck,
Hamish
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
More information about the grass-user
mailing list