[GRASS-dev] pj_transform problem: failed to load NAD27-83 correction file

Hamish hamish_nospam at yahoo.com
Sun Oct 22 23:57:04 EDT 2006

Yann Chemin wrote:
> > > I am trying to make a program writing a latitude map.
> it simply fills up the pixels with Latitude values.
> http://www.star.ait.ac.th/~yann/sebal/r.latitude.tar.gz

Here is how to do it in a shell script, using r.stats, m.proj, and
r.in.xyz. (slower than a C version, but uses just standard grass modules
and unix tools)

r.stats -1gn fields | cut -f1,2 -d' ' > fields_coord.txt
# datum will be WGS84!! use "proj_out=" if you want another datum
m.proj -od < fields_coord.txt | awk '{print $2}' > lat_values.txt
paste -d' ' fields_coord.txt lat_values.txt > fields_lat_coord.txt
r.in.xyz in=fields_lat_coord.txt fs=space out=fields_lat
\rm fields_coord.txt lat_values.txt fields_lat_coord.txt 

another idea is to add lat() and lon() as r.mapcalc internal variables,
just like x() and y(). But you must deal with the "which datum to use?"


More information about the grass-dev mailing list