bringing in point data from ARC

Scott Miller miller at tucson.ars.ag.gov
Wed Jun 28 18:26:29 EDT 1995


Daniel,

To bring ARC point data into GRASS, you first need to have an
ungenerated ARC file (in ARC:  ungenerate point <cover> <cover.lab>).
Having this file in hand, you can jerk it sround using an editor (or
awk or perl script preferably) to get it into the necessary GRASS
format.  ARC creates an ungenerate file with the following format:

$recno  x-coord	  y-coord
1	xxxxxxx	  yyyyyyy
2	xxxxxxx	  yyyyyyy

while GRASS needs the point data to look like this:

xcoord | ycoord | attribute

So, to get the file into GRASS format, you could awk it around like
so:

awk ' {print ($2, "|", $3, "|", $1)}' < cover.lab > yourname

If you prefer to use the GRASS program s.in.ascii, substitute

awk ' { print ($2, $3, $1) } ' < cover.lab > yourname

Notice that this process puts the record number into the attribute
column in GRASS, which may or may not be what you want.  You may need
to create another file of the attributes and then add it onto the
first column of the .lab file in place of the $recno, or as the third
column of a post-awked file.  This would require some minor perl 
programming or a good editor.  

I hope you find this useful.  Please contact me with any questions you
may have.  Good luck,

Scott


----------------------------------------------------------------
Scott Miller			e-mail: miller at tucson.ars.ag.gov
USDA - ARS SWRC			phone:  (602) 670-6380 ext. 156
2000 E. Allen Rd.		fax:  (602) 670-5550
Tucson, AZ  85729
----------------------------------------------------------------




More information about the grass-user mailing list