[GRASS5] Re: [Fwd: ArcInfo ungenerate]

Malcolm Blue mblue at nb.sympatico.ca
Tue Apr 24 16:59:16 EDT 2001


I was using Arcinfo this afternoon, so I looked in the help file for info on the
GENERATE format.  This might be useful for future reference if anyone else reports
problems, although with all the other formats supported, GENERATE might not be too
popular anymore.  I copied the pages for Points (includes polygon label points), Lines
and Polygons.  The polygon format may not be fully supported by the v.in.arc.poly
routines, according to the readme file in that directory.

HTH,

Malcolm


Points
Adds points to a point coverage, or label points to a polygon coverage.
Enter one point per line specifying the Point ID and X,Y location for the point
feature.
Point ID,X,Y:
601,3,7
602,9,7
603,5,4
end

Lines
Adds arcs to the coverage.
Enter the Line ID for the line feature then enter the X,Y coordinate pairs, one pair
per line. The coordinates of each pair may be separated with a comma or a space. Use
the keyword end to end one line and then start another with a new User-ID.  End the
file with a final end keyword after the end of the last line.
ID:
X,Y:
X,Y:
X,Y:
X,Y:
ID:
501
2,8
5,8
5,5
end
502
1,2
4,5
end
end

Polygons
Adds polygons and label points to the coverage.
Enter a Polygon ID and the X,Y coordinates for the polygon label on a separate line.
Then enter the x,y coordinate pairs for each vertex along the polygon boundary. The
coordinates of each pair may be separated with a comma or a space. Multiple coordinate
pairs may be placed on a single line if they are separated by semicolon.
Do not use a Polygon ID = -99999. This has a special meaning. The Coverage to Generate
File tool, when used on polygons, flags all island polygons with this special ID. The
Generate to Coverate Wizard will ignore all polygons with an ID of -99999.

If 0 is entered for ID,X,Y, then no polygon label will be generated for that polygon.
For automatic polygon label placement enter AUTO after the POLYGON-ID rather than
coordinate values.
Polygons will be closed automatically from the last vertex entered to the first vertex,
if the two vertices are not the same.
The User-ID of the arcs that make up the newly generated polygon features will be zero.

ID,X,Y:
X,Y:
X,Y:
X,Y:
X,Y:
X,Y:
X,Y:
X,Y:
ID,X,Y:
701,7,7
3,9
4,5
8,4
9,7
6,9
3,9
end
end


Michel Wurtz wrote:

> Malcolm Blue wrote:
> >
> > Markus,
> >
> > I think that GENERATE format can include commas.  The following quote is from a
> > response on the ESRI knowledge base describing how to create a GENERATE file from
> > INFO:
> >
> > 'The output file created will be used with the GENERATE
> >         command, which will read commas as field delimiters. '
> >
> > It appears either space or comma can be used.
>
> Well... I spent a little time on v.in.arc : the problem is in
> process_inp.c, which looks :
>
> int process_inp (char *inp)
> {
>    G_remove_commas(inp);
>    while(*inp)
>    {
>      if((*inp=='D')||(*inp=='d'))  *inp='e';
>      inp++;
>    }
>    return 0;
> }
>
> G_remove_commas() appears only in v.in.arc and v.in.arc.pg (which is
> based on v.in.arc).  the function is define in libes/gis/commas.c,
> and the comment you found before the function is :
>
> /* removes commas from strings representing a number
>         1,234,567    becomes 1234567
>         1,234,567.89 becomes 1234567.89
>         12,345       becomes 12345
>         1234         stays   1234
> */
>
> There is also a G_insert_commas() function for the opposite, that is a
> little more used.  Here is the command i used from the grass/src dir :
>
> bash-2.03$ find . -name '*.c' -exec grep G_insert_commas {} /dev/null \;
> ./src/libes/gis/commas.c:int G_insert_commas(
> ./src/libes/gis/edit_cellhd.c:    G_insert_commas(buf);
> ./src/raster/r.report/cmd/format.c:    G_insert_commas (temp);
> ./src.contrib/SCS/vector/v.report/cmd/format.c:    G_insert_commas (buf);
>
> so it appears that
>
> 1- G_remove_commas() in never used except where it causes trouble
> 2- G_insert_commas() seems only used to put commas on rare occasions
>
> Should we keep them in the future release, or modify
> src/libes/gis/edit_cellhd.c, src/raster/r.report/cmd/format.c and
> src.contrib/SCS/vector/v.report/cmd/format.c (which seems a duplicate
> from the former)
>
> In the meantime, I have modified src/mapdev/v.in.arc/process_inp.c
> and src.garden/grass.postgresql/v.in.arc.pg/process_inp.c to
> replace commas by spaces.  This should correct the problem.
>
> --
> Michel WURTZ - DIG - Maison de la télédétection
>                500, rue J.F. Breton
>                34093 MONTPELLIER Cedex 5
>
> ----------------------------------------
> If you want to unsubscribe from GRASS Development Team mailing list write to:
> minordomo at geog.uni-hannover.de with
> subject 'unsubscribe grass5'


---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list