ARC/INFO to GRASS conversion

Ronald Wiemer RWIEM at ARCHIS.NL
Wed Mar 15 03:48:17 EST 1995


> Dear GRASS-users
> 
> I will import ARC/INFO vector-files to GRASS. These files contain either area 
> coverage data or contour lines and have far more than 2000 lines/polygons each.
> 
> At this point we try to import a relatively large map containing polygon 
> features (like a soil map for example). The data were exported using the 
> UNGENERATE and DISPLAY functions of ARC/INFO resulting in a lines file (.ply), 
> a label point-file (.pnt) and a label-text file (.txt), according to the
> v.in.arc man pages of the users reference manual.
> 
> Importing the file using v.in.arc worked without any problems. But when
> running v.support, only about half of the polygons were not recognized as
> areas and could not be recognized. I got an error message like
> 
> PNT_TO_AREA failed: (3500166.000000 6056598.500000) (Category 4)
> 
> Using v.digit, I could see that the problematic polygons seem to be
> characterized by a connection to another area both at the start and the end 
> point of the polygon, that means, the polygons are not closed by itself.
> 
> I would like to ask if there is a chance to import these ARC/INFO files, either
> by choosing another export/import format like DXF or by changing export options
> of ARC/INFO resulting in completely closed polygons. The important point to me 
> is to have a completely labelled vector area map after importing, because this 
> map has to transformed into raster format.
> 
> Thanks in advance
> Ralf Kunkel                                                             
> 
>                                                                                 Phone: +49-2461-3262
> Program Group Systems Analysis and                    Fax:      +49-2461-2540
> Technological Development (STE)                          E-mail: r.kunkel at kfa-juelich.de
> Research Center (KFA) Juelich
> D-52425 Juelich, Germany
> 

There is a bug in the v.in.arc program. I didn't manage to locate the 
bug since the program is a bit spagghetti wise. Since I had the same 
problem, I made a small program that converts the .lin files to 
dig_ascii (without header). After putting a header before the 
dig_ascii file, and running v.in.asc, you can use awk to make an
attribute file fom your .pnt file and put it in the proper directory 
(dig_att). Then run v.support.



/* Begin program in_arc.c */
/* usage: in_arc < file.lin > $LOCATION/dig_ascii/file.asc */

#include <stdio.h>

main()
{
    double xarr[10000], yarr[10000], x, y, dummy;
    char buffer[256];
    int teller,i;
    char mend[3];
    teller = 1;
    x = 0.; y= 0.; dummy = 0;
    while (NULL != gets(buffer))
    {
        if (sscanf(buffer,"%lf %lf %lf", &x, &y, &dummy) == 2)
        {
            xarr[teller]=x;
            yarr[teller]=y;
            teller++;
        }
        else if (strncmp("END",buffer,3)==0 && teller > 1) 
        {
            printf("A %d\n",teller-1);
            for (i = 1; i < teller; i++)
                printf("%14.6lf  %14.6lf\n",yarr[i],xarr[i]);
            teller = 1;
        }
    }
}

/* end in_arc.c */



More information about the grass-user mailing list