Feature Representation
In addition to the generic FME feature attributes that FME Workbench adds to all features (see the chapter About Feature Attributes), this format adds the format-specific attributes described in this section.
All Generate features contain a numeric ID field. The numeric ID is stored in the arcgen_id attribute of an FME feature read from a Generate file or destined to be written to a Generate file.
Tip: Features being written to an ARCGEN file must have an arcgen_id attribute.
FME considers the basename of the Generate file to be the FME feature type of a Generate feature. The feature type of a Generate feature must match the basename of a Generate file defined by a Generate DEF line. Each feature read from a Generate file has an ARCGEN_GEOMETRY attribute added to it that indicates if the feature came from an arcgen_point, arcgen_line, or arcgen_text file. The writer can also handle homogeneous aggregate features of points, lines or text, which also have an ARCGEN_GEOMETRY attribute.
Points
Generate files containing only points consist of a series of lines that follow this syntax:
<idNumber>,<x>,<y>[,<z>]
Tip: By using the idNumber associated with each Generate feature as a key into a comma-separated value file, the @Relate command can be used to attach attributes to Generate features.
The <idNumber> is any numeric value, and need not be unique within a file. As well, the <z> value is optional and, if it is not specified, the point is considered to be two-dimensional. The file is terminated by a line containing only the word END.
A two-dimensional point Generate file example is shown below:
601,3,7 602,53,21 603,19,20 END
Lines
Generate files containing only linear features consist of a series of lines that follow this syntax:
<idNumber> <x0>,<y0>[,<z0>] <x1>,<y1>[,<z1>] … <xN>,<yN>[,<zN>] END
Tip: Polygonal features may also be input and output using linear Generate files. In such cases, the first point and the last point of the line are identical.
As with point files, the <idNumber> is any numeric value, and need not be unique within a file. As well, the <z> value is optional and, if it is not specified, the linear feature is considered to be two-dimensional. The end of each linear feature is marked by a line containing only the word END. A linear Generate file is terminated with two consecutive lines containing only the word END. A three-dimensional linear Generate file example, containing two features, is shown below:
101 32,52,1 33,56,2 36,59,6 31,70,3 END 102 52,32,3 53,56,5 56,29,1 61,73,14 END END
Text
Generate files containing only text (annotation) features, consist of a series of lines that follow this syntax:
<idNumber>,<x>,<y>,<angle>,<size>,<text>
As with point files, the <idNumber> is any numeric value and need not be unique within a file. A Text generate file is terminated with the word END. A text Generate file example, containing two features, is shown below:
101,32,52,0,20,Arnet Maves 102,52,32,90,30,Barnie Maves END
The attributes used by the generate reader and writer are described in the following table.
Attribute Name |
Value |
arcgen_rotation |
Specifies the rotation of the text in degrees measured counterclockwise from horizontal. Range: -360.0 . . . 360.0 Reprojectable: Yes |
arcgen_text_size |
The size of the annotation in ground units. Range: Float > 0 Reprojectable: Yes |
arcgen_text_string |
The text string to be placed at the annotation location. Range: Any text string |
The example below shows an FME mapping file used to translate some points and linear features from the Generate format into Shape files. The mapping file defines the dataset location and gives the Generate definitions for the two files to be read. At run time, the Generate reader goes out to the folder, reads the files, and produces an FME feature for each Generate feature it finds.
Sample Generate to Shape Mapping File:
# --------------------------------------------- # Define the location of the Generate files ARCGEN_DATASET /usr/data/generate/92i080 # --------------------------------------------- # Define the type of each of the Generate files ARCGEN-_DEF nodes ARCGEN_GEOMETRY arcgen_point # --------------------------------------------- # This second file uses a space as the delimiter ARCGEN-_DEF boundaries ARCGEN_GEOMETRY arcgen_line \ ARCGEN_DELIMITER “ “ # --------------------------------------------- # Now define the location of the Shape files # which will be created SHAPE_DATASET /usr/data/shape/92i080 # --------------------------------------------- # Define each of the Shape files. SHAPE-_DEF markers SHAPE_GEOMETRY shape_point \ MARKER_ID number(6,0) SHAPE_DEF edges SHAPE_GEOMETRY shape_polyline \ EDGE_ID number(6,0) # --------------------------------------------- # Now define transfer specifications ARCGEN nodes arcgen_id %nodeNum SHAPE markers MARK_ID %nodeNum ARCGEN boundaries arcgen_id %boundNum SHAPE edges EDGE_ID %boundNum
Tip: Notice the Shape file definitions create a field to store the identifier associated with each generate feature.
If the /usr/data/generate/92i080 folder contained the following files:
nodes.gen |
boundaries.gen |
601,7,7 602,53,21 603,19,20 END |
101 32 52 1 33 56 2 36 59 6 31 70 3 END 102 52 32 3 53 56 5 56 29 1 61 73 14 END END |
...then the FME features shown below would be created by the Generate reader.
Feature Type: nodes |
|
Attribute Name |
Value |
ARCGEN_GEOMETRY |
arcgen_point |
arcgen_id |
601 |
Coordinates: 37,7 |
Feature Type: nodes |
|
Attribute Name |
Value |
ARCGEN_GEOMETRY |
arcgen_point |
arcgen_id |
602 |
Coordinates: 53,21 |
Feature Type: nodes |
|
Attribute Name |
Value |
ARCGEN_GEOMETRY |
arcgen_point |
arcgen_id |
603 |
Coordinates: 19,20 |
Feature Type: boundaries |
|
Attribute Name |
Value |
ARCGEN_GEOMETRY |
arcgen_line |
arcgen_id |
101 |
Coordinates: (32,52,1),(33,56,2),(36,59,6),(31,70,3) |
Feature Type: boundaries |
|
Attribute Name |
Value |
ARCGEN_GEOMETRY |
arcgen_line |
arcgen_id |
102 |
Coordinates: (52,32,3),(53,56,5),(56,29,1),(61,73,14) |
Feature Type: boundaries |
|
Attribute Name |
Value |
ARCGEN_GEOMETRY |
arcgen_line |
arcgen_id |
101 |
Coordinates: (32,52,1),(33,56,2),(36,59,6),(31,70,3) |
Feature Type: boundaries |
|
Attribute Name |
Value |
ARCGEN_GEOMETRY |
arcgen_line |
arcgen_id |
102 |
Coordinates: (52,32,3),(53,56,5),(56,29,1),(61,73,14) |
These features would then be transformed by the FME and output to their destination Shape files by the Shape writer.