FeatureCreator
FeatureCreator easily allows workspace designers to directly insert a table of fixed data into the Workspace and auto-generate Features from it.
The table format required is a block of text of tabular rows of delimited values. Typical use cases are for when there is a need to create directly within the Workspace data without having to read from external data sources Eg. A fixed lookup/data table directly insidethe Workspace, or to generate a sample of data for testing, or to setup/copy examples of data from the Safe Forums etc.
This simplifies creating multiple features with different attributes and different values per Feature within one Transformer.
Auto-translation from Microsoft Excel Copy/Paste worksheet data directly into the Transformer's Text Data Box is supported. Any Tab characters detected in the Text will override the separator character parameter setting to interpret the Table as Tab-delimited.
Geometry support is provided through the optional use of a reserved Text Field Name "Geometry" and Well-Known Text. If no field named "Geometry" is used, the Transformer will translate the table as non-spatial data. If instead valid Well-Known-Text (WKT) geometry data is input within the "Geometry text field, the Transformer will convert the data to FME Feature Geometry. Care must be taken to use text qualifiers such as " around WKT values as the WKT syntax uses commas inside the WKT values. Unqualified WKT text values will be prematurely escaped on commmas if the user also specifies that the text table fields/values are comma-delimited, and generate Translation Log warnings of improperly formatted WKT.
The user may optionally assign a Coordinate System to the output Geometry data, however this can also be achieved separately using CoordinateSystemSetter.
The first row of the data table text is reserved for the Attribute Names. These must be qualified where the name uses a character that is the same as the delimiter character.
Except for the last row, each row must be delineated be pressing "Enter" or equivalent to generate a newline character. Excess new line characters after the last row are ignored and Features will only be generated up to the last non-blank row of data.
The user must manually type the Attribute Names to Expose as a comma delimited, qualified set of attribute names. FME will not expose the Attributes if the Attribute Names to Expose do not use " as the Attribute Name qualifier. The Transformer will output the data table regardless of the settings as unexposed or exosed Attributes, however this is needed to expose the Data Table field names to the Workspace. Alternativley the user can use a separate AttributeExposer transformer afterwards to expose the text table fields.
Each Feature set is generated from the selected number of instances to generate. The Creation Instance ID Attribute may optionally be specified and output. The fme_feature_name attribute of output Features is "FeatureCreator"
As an option, Attribute names may be separately specified to store a per Table Row Key Unique ID integer, and an overall Transformer Feature Output Key Unique ID integer. Both are index zero values.
The Transformer uses the FME CSV Reader to create a temporary text file and interpret the block of Text back through a CSV Reader. Further customisation from the default CSV Reader settings can be made such as choice of delimited character, the qualifying text character etc.
The default setting is to output all text values found as a String Data Type, however this may be overriden by specifing within the embedded CSV Reader to attempt to detect the data type of the text. Beware that this can have unintended effects on the interpretation of numeric strings, such as dropping leading "0" characters.
Would you like to know more? Click here to find out more details!