[GRASS5] set map title and metadata info using r.support

Glynn Clements glynn at gclements.plus.com
Tue Mar 28 14:44:21 EST 2006


Hamish wrote:

> While on "read", another question: For a while I've wanted to have a
> port of m.proj2 in GRASS 6, but as a script calling cs2cs. Especially
> the -i and -o options to convert a list of coordinates from WGS84
> lat/lon into the current projection and convert grid coords to WGS84 LL.
> 
> It's pretty easy:
>  IN_PROJ="+proj=longlat +towgs84=0.000,0.000,0.000"
>  OUT_PROJ="`g.proj -jf`"
>  cs2cs -f %.8f $IN_PROJ +to $OUT_PROJ < "${TMP}.in" > "${TMP}.out"
> 
> Right now I just do this by hand, but it would be great to be able to
> reduce the above to "m.proj -i" plus redirection.
> 
> What I haven't been able to figure out is how to have a bash script
> optionally accept input piped from stdin. My attempts using read have
> been unsatisfactory. This should work the same way as both v.in.ascii
> and v.out.ascii. Both input= and output= options are optional filenames or
> if omitted assumed to be stdin, stdout.

Can you clarify? Are you asking about how to make redirection
conditional, or something else?

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list