Specifying Metadata Records

The metadata records in a CCOGIF file contain many pieces of information that must be correctly defined for the file to be accurate. Much of this information is for the benefit of human users of the end product and may vary not only from site to site, but from one dataset to another. This information cannot be coded into FME itself, therefore it must be supplied into the mapping file.

The CCOGIF writer expects this information to be passed in the same metadata features that the CCOGIF reader creates. If the writer receives a feature with a feature type of CCOGIF_METADATA, it will look at the ccogif_record_code attribute to see which of the metadata features, described in Metadata Features, the feature represents. It extracts from this feature whatever ccogif_XXX attributes apply to that particular type of metadata feature and eventually writes the information to the metadata records in the output CCOGIF file.

The order of the incoming metadata features is significant, as they are written out in a similar order to which they are received. Any volume-specific metadata must come before the Data Set Header Record (DSHR). Metadata features received after the DSHR appear in the output CCOGIF file as a part of the dataset.

In addition, all metadata features must be presented to the writer before any entity features are presented. The CCOGIF writer needs information from the DSHR in order to write entity data, so it creates a default DSHR if none has been given. Any metadata that comes after the default DSHR has been generated may contradict the default values placed into the DSHR, resulting in an invalid output CCOGIF file.

Several ways to generate the metadata features for the CCOGIF writer are discussed below:

  • Use the Multi-Reader as the input reader and use a template CCOGIF file as a source for CCOGIF_METADATA features. In other words, specific metadata features may be chosen from this reader, then redirected to the writer to provide attribute values for the corresponding metadata records in the output.
  • Store the template’s CCOGIF_METADATA features in a feature store and use the RecordingFactory to inject them into the feature stream. If this method is chosen, it’s important to choose the playback mode of PLAYBACK instead of PLAYBACK_AT_END.
  • Use the CreationFactory to create the metadata features with all of the required attributes.

Once the features have been generated, they have to be handed to the writer with a feature type of CCOGIF_METADATA. This can be accomplished by creating a false theme in any of the groups in the output file such as:

CCOGIF_DEF CCOGIF_METADATA 									\
    CCOGIF_GROUP_NAME "FEATURES"

With this definition in place, you can correlate the metadata features to the CCOGIF_METADATA feature type of the output format. This correlation must equal all ccogif_xxx attributes on the source and target sides for all metadata feature types being correlated. For example:

CCOGIF CCOGIF_METADATA 	\
   ccogif_adj_name           %ccogif_adj_name	\
   ccogif_area_to_ln_topo    %ccogif_area_to_ln_topo	\
   ccogif_attrs_in_entity    %ccogif_attrs_in_entity	\
   ccogif_bytes_prev_rec     %ccogif_bytes_prev_rec	\
   ccogif_colloc_exists      %ccogif_colloc_exists \
   ...
   ccogif_z_min_value        %ccogif_z_min_value

SHAPE CCOGIF_METADATA	\
   ccogif_adj_name           %ccogif_adj_name	\
   ccogif_area_to_ln_topo    %ccogif_area_to_ln_topo	\
   ccogif_attrs_in_entity    %ccogif_attrs_in_entity	\
   ccogif_bytes_prev_rec     %ccogif_bytes_prev_rec \
   ccogif_colloc_exists      %ccogif_colloc_exists \
  ...
   ccogif_z_min_value        %ccogif_z_min_value

The following sections describe ways in which some of the types of metadata features are treated specially by the CCOGIF writer. This special treatment simply ensures that the record exists and has some legal, if not meaningful, default values in place for the ccogif_XXX attributes.