Text Feature Store (TFS) Variable Schema Reader/Writer
This chapter describes how FME reads and writes Text Feature Store (TFS) Variable Schema files.
Overview
TFS Variable 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 three programming languages:
- C++ TFS Variable Schema
- Java TFS Variable Schema
- Python TFS Variable Schema
TFS Variable 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 Variable Schema files store both geometry and attributes for features. A logical TFS Variable Schema dataset consists of one or more files in the same folder with the extension .tfs. This extension is added to the base name of the TFS Variable Schema files. The files within the folder are divided by the feature types of a dataset. Meaning each file contains one or more features of the same feature type.
In addition to sharing the same feature type, the features within a TFS Variable Schema file also share the same list of user-defined attributes. In other words, all features belonging to the same TFS Variable Schema file have the same value for the feature type and the same list of user-defined attributes. The values of the user-defined attributes can vary from feature to feature within the same TFS Variable Schema file. The feature type and the names of the user-defined attributes for an individual TFS Variable Schema file are specified in the DEF line for that TFS Variable Schema file.
Schema information for a dataset is explicitly stored in the header of TFS Variable Schema files.
TFS Variable 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 Variable 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 Variable 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 (of the same feature type).
Reader Overview
The TFS Variable Schema reader produces FME features for all feature data held in the TFS Variable 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 Variable Schema writer creates and writes feature data to TFS Variable Schema files in the folder specified by the DATASET directive. Any old TFS Variable Schema files in the folder are overwritten with the new feature data.
As features are routed to the TFS Variable Schema writer by the FME, the writer determines the file they are to be written to and outputs them according to the type of the file.
Many TFS Variable Schema files can be written during a single FME session.