stason.org logo lotus


previous page: 6.4: How do you convert ARC coverages to IDRISI? (Geographic Information Systems)page up: Geographic Information Systems FAQnext page: 6.6: Where can I find some AMLs to look at? (Geographic Information Systems)

6.5: How do I convert ARC coverages to GRASS? (Geographic Information Systems)

 Books
 TULARC
















Description

This article is from the Geographic Information Systems FAQ, by Lisa Nyman lnyman@census.gov with numerous contributions by others.

6.5: How do I convert ARC coverages to GRASS? (Geographic Information Systems)

[Ed. note: As with most lists, this one has been edited
due to length.]

For help with ESRI products and importing or exporting data formats,
see the ESRI web site
http://www.esri.com

From: Steve Bower <steveb@VCGI.UVM.EDU>

SUMMARY: Arc/Info -> GRASS data conversions.
----------------
From: cg@cast.uark.edu

TOPIC: Convert a polygon coverage from Arc/Info to GRASS

Use a coverage named 'school' as an example to show the procedure:

STEP 1. --- Get data out of Arc/Info
1.1 get line data
Arc: ungenerate line school school.lin

1.2 get label point data
Arc: ungenerate point school school.lab

1.3 get label text (attribute) data from INFO
ENTER COMMAND >OUTPUT ../school.txt

ENTER COMMAND >SELECT SCHOOL.PAT
12 RECORD(S) SELECTED

ENTER COMMAND >LIST PRINT (See Note2)

ENTER COMMAND >Q STOP

  school.txt should look like this:
  $RECNO     AREA PERIMETER SCHOOL# SCHOOL-ID SCHOOL-NAME
    1   -2.46815E+09  216,729.700  1    0
    2   3.871248E+08  121,106.100  2    5  Springdale
    3   2.923594E+08  114,518.100  3   11  Fayetteville
    4   2.754085E+08  144,500.300  4    6  Prairie Grove (See Note1)
    5   83192210.000   54,980.120  5    7  Farmington
    6   98547120.000   53,769.720  6    4  Siloam Springs
    7   3.852254E+08  112,999.100  7    3  Lincoln
    8   2.611844E+08  101,406.700  8    1  Elkins
    9   1.898218E+08  112,633.000  9    8  Greenland
   10   2.734009E+08  101,322.400 10    9  West Fork
   11   1.676338E+08   66,904.990 11    2  Winslow
   12   54256160.000   32,175.590 12   10  West Fork

STEP 2. --- Bring data into GRASS
2.1 create a subdirectory called 'arc' in your current mapset if necessary
and copy school.lin school.lab school.txt to the 'arc' directory

GRASS 4.1beta>v.in.arc type=polygon lines_in=school.lin points_in=school.lab
text_in=school.txt vector_out=sch_dist idcol=5 catcol=5 attcol=6

GRASS 4.1beta > v.support map=sch_dist

Note1: If the attribute text contains blank,(for example,Prairie Grove), the
second word is dropped after running 'v.in.arc'. My only suggestion
is to edit the dig_cats file so that the complete attributes can be
retained.

Note2: If the PAT file contains a lot of columns, you have to use the INFO
command - REPORT to create a report which looks like the above
example(school.txt). For more information about REPORT refer to
INFO Reference Manual.
----------------

1) UNGENERATE the ARC coverage. Coverages that will end up as GRASS
vector files need only lines, e.g. UNGENERATE lines <your_coverage>.
Those that contain polygons and are destined to become raster layers
need lines and points, eg:

UNGENERATE lines <your_coverage> <lines_output_filename>
UNGENERATE points <your_coverage> <points_output_filename>

Next, use DISPLAY or PRINT (I think-- this is from memory) from within
INFO to print out the fields you need from the database.

2) Move all of the ungenerated files and the database text files to
$LOCATION/arc-- you'll probably have to create the arc directory
yourself. The files MUST be in this directory. $LOCATION is defined
by GRASS at startup, so if you mv them from within a GRASS session,
they'll go to the right place.

3) Use v.in.arc to suck the files into GRASS. The g.manual entry
explains things pretty well. This is probably where problems will
occur if any occur at all. This program is touchy about the format of
the ungenerated file.

4) Run v.support on the resulting file. Be sure to use the <build>
option. In my experience, v.support generates tons of error messages,
but few of these are ever significant, so don't let them throw you.

5) Run v.digit on the v.support output. At a minimum, run v.digit with
no digitizer (mouse mode), fill in the information regarding scale,
window boundaries, etc, then let v.digit draw the file. When it
finishes, you can either save the resulting vector layer as is or
modify it. If it is destined for raster-hood, you should probably
check and make sure that all polygons are closed-- see the v.digit
tutorial for additional details if you need them.

6) If you want to build raster coverages, run v.to.rast on the vector
layer after v.digit. As I recall, v.to.rast creates a HUGE temporary
file, so be sure you have lots of disk space available.

7) Run r.support to assign a color table, check category labels, etc.
Voila-- you're done!

Michael Camann camann@dial.pick.uga.edu

 

Continue to:


Share and Enjoy

Bookmark this story so others can enjoy it:
  • digg
  • Reddit
  • del.icio.us
  • Furl
  • Wists

Tags

science, engineering, geographic information systems, GIS, NCGIA, maps







TOP
previous page: 6.4: How do you convert ARC coverages to IDRISI? (Geographic Information Systems)page up: Geographic Information Systems FAQnext page: 6.6: Where can I find some AMLs to look at? (Geographic Information Systems)