Importing raster data

Stephan Eickschen eicksch at uni-muenster.de
Tue Jan 20 10:26:36 EST 1998


Hi Thomas-

> 
> I'm trying to import a raster file in ascii/text format with lat/long
> coordinates into GRASS. The file has the following format:
> 
> north: 47.937500000000
> south: 24.062500000000
> east: -66.479166666667
> west: -90.520833333333
> rows: 573
> cols: 577
> 785 790 786 783 779 771 768 766 ...

I do not know, if it is possible to do the conversion with awk, but what
you might do, is to write a small program, that writes your data to
your sites directory and then do the import with an interpolation... ;-)
Have a look at the following part of my script, which runs at the GRASS-
prompt, doing this "task":

cd $HOME/grass_data/$LOCATION/$MAPSET/site_lists/
YOURPROGRAM YOURFILE >! $NAME
s.surf.idw input=$NAME output=$NAME
g.remove sites=$NAME

where YOURPROGRAM should do a conversation from YOURFILE to a file that
has the format

lon|lat|val

Do not forget the "|"!!!
(In my example YOURPROGRAM writes to stdout)

Regards,

	Stephan

P.S.: It might be not very nice, but it works  ...

-- 
------------------------------------------------------------------------

Stephan Eickschen                     Tel. : +49 (0)251 83-34704
Westfaelische Wilhelms-Universitaet   Fax. : +49 (0)251 83-36100
Institute for Geophysics
Research Unit of Physical Glaciology  email: eicksch at uni-muenster.de
Corrensstrasse 24
48149 Muenster
Germany

------------------------------------------------------------------------



More information about the grass-user mailing list