Arc/Info dxf file to Grass vector

Bob Feeney feeney at vinny.cecer.army.mil
Wed Jan 5 10:07:00 EST 1994


  Apparently the problem is that "v.in.arc" is not being used correctly.
  People have been using it successfully for a long time (with a somersault
  here or there).  Following are a couple of suggestions from the net.

  Basically, there are TWO main steps:
  1. UNGENERATE the data in ARC/INFO, including the labels.
  2. Import the data into GRASS using "v.in.arc".

  ////\\\\////
  Scott Wade

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


   SUMMARY: Arc/Info -> GRASS data conversions.
   
   ORIGINAL QUESTION:
   
   We are an Arc/Info shop, but would like to distribute data in a format for
   conversion to GRASS.  All I know (from one source) is that I should
   provide the data in DLG format with no transformation.  I've read ARCDLG,
   so I know that attributes are a pain: that is, I believe I will have to
   convert my attribute tables to MAJOR/MINOR pairs, or generate an ACODE
   file.
   
   Does anyone have any automated programs or other custom software for this
   conversion?  Any tricks of the trade and known pitfalls would be
   appreciated.  A summary will be posted - thanks in advance.
   
   Steve Bower, Vermont Center for Geographic Information, 802-656-4277.
   
   ####################################################



   Return-Path: camann at pick.uga.edu
   
   I have done a number of A/I to GRASS conversions.  The basic technique
   is:
   
   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 at dial.pick.uga.edu
   Department of Entomology                camann at athena.cs.uga.edu
   University of Georgia                   (706) 542-1388
   Athens, GA 30602                        (706) 542-2276

###########################################################################



   
   Return-Path: cg at cast.uark.edu
   
   I've done some data conversion between Arc/Info and GRASS.
   I wrote a step by step process, and hope you find it helpful.
   
   ================================================================
   
   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.
   
   #################################################################################



More information about the grass-user mailing list