Text Feature Store (TFS) Fixed Schema Reader/Writer
This chapter describes how FME reads and writes Text Feature Store (TFS) Fixed Schema files.
Overview
TFS Fixed Schema is a model format that is distributed as part of FME’s Plug-in SDK to demonstrate how to create reader/writer plug-ins in various programming languages. There are two flavors available in FME – C++ TFS Fixed Schema, which is implemented in C++, and Java TFS Fixed Schema, which is implemented in Java.
TFS Fixed Schema is a text-based format, which can be read and edited with the use of a text editor. Being able to edit datasets with a text editor allows for simple creation of features with a limitless possibility in terms of their geometries.
TFS Fixed Schema files store geometry and a fixed attribute for features. A logical TFS Fixed Schema dataset consists of one file with the extension .tfs. This extension is added to the base name of the TFS Fixed Schema file. Within this file there can contain many features of various feature types.
The schema for the TFS Fixed Schema format is fixed or static for all datasets. Therefore, schema information does not need to be explicitly stored in TFS Fixed Schema files. Even though a TFS Fixed Schema file may contain many features of varying feature types, all TFS Fixed Schema files can only translate features with the following schema information:
Feature Type: FeatureA Attribute: tfs_id Geometries: tfs_point, tfs_line, tfs_polygon, tfs_arc, tfs_text, tfs_multi_text, tfs_ellipse, tfs_collection, tfs_surface, tfs_solid, tfs_null Feature Type: FeatureB Attribute: tfs_id Geometries: tfs_point, tfs_line, tfs_polygon, tfs_arc, tfs_text, tfs_multi_text, tfs_ellipse, tfs_collection, tfs_null
Note: tfs_surface and tfs_solid are not implemented in Java TFS Fixed Schema.
Since schema information is not explicitly stored in a TFS Fixed Schema file, the schema information portion of a TFS Fixed Schema file is left blank. The syntax is as follows:
FEATURE_SCHEMA_INFORMATION END
A feature within a TFS Fixed Schema file is represented using the following syntax:
FEATURE_TYPE: <FeatureTypeName> { [<attrName> <attrValue>]+ } GEOMETRY: <geometryDefinition>
TFS Fixed Schema files contain a coordinate system definition that applies to all the features it contains, if any. The coordinate system definition is stored in the header of the TFS Fixed Schema files following the schema information. In the case where a dataset does not contain a coordinate system, the coordinate system definition’s value is not specified.
The geometries on the features of a TFS Fixed Schema file may be both two- and three-dimensional. Furthermore, the dimensionality of geometries on a feature is independent of geometries on other features within the same file.
Reader Overview
The TFS Fixed Schema reader produces FME features for all feature data held in the TFS Fixed Schema file specified to be read. The features are read and processed one at a time from the file. When a feature from the file is read, the FME feature produced gets its feature type set, then its attributes set, and finally a geometry is created and set on the FME feature.
Writer Overview
The TFS Fixed Schema writer creates and writes feature data to the TFS Fixed Schema file specified by the Dataset parameter. Any existing TFS Fixed Schema file is overwritten with the new feature data.