Rulebase Pack
From fmepedia
| This page contains a Custom Transformer created by an fmepedia user. See the attached files list at the foot of this page for the zip file containing this custom transformer. |
Created by: Mark Ireland
The Rulebase Pack consists of two custom transformers: the RulebaseChecker and the RulebaseAttributeChecker
Each transformer takes incoming features and compares them to a set of rules defined in a rules file.
Rulebase Checker
The RulebaseChecker tests feature geometry against the pre-defined rules. There is a set of rules per feature type.
The rulebase tests carried out are...
- FeatureTypeName - does the feature have a valid feature type.
- Geometry Type - is the feature's geometry type valid for this feature type.
- Geometry Dimension - should the geometry be 2d or 3d
An example Rulebase file is as follows...
FeatureTypeName,GeometryType,2or3D GeometryType = xxxx where x = Y/N for point/line/polygon/text/null 2or3D = 2 or 3 (no geometry = 2) --------------------EXAMPLE-------------------- level1,NYYNN,2 ----DON'T DELETE THIS OR ANY PRECEEDING LINE---- level1,YNYNY,2
Rulebase Attribute Checker
The RulebaseAttributeChecker tests feature attributes against the pre-defined rules. There is a set of rules per attribute.
The attribute tests carried out are...
- AttributeName - does the feature have valid attribute names.
- Min Length - does the attribute meet the minimum length requirement
- Max Length - does the attribute meet the maximum length requirement
- Attribute Type - are the attribute contents valid for this attribute type (is it an integer, char, float or date)
An example Attribute Rulebase file is as follows...
FeatureTypeName,AttributeName,MinLength,MaxLength,Type Type = x where x = C (Char) I (Integer) F (Float) D (Date) --------------------EXAMPLE-------------------- level1,attribute1,0,10,C ----DON'T DELETE THIS OR ANY PRECEEDING LINE---- level1,attribute1,4,10,C level1,attribute2,0,5,I
Output
Each transformer has separate ports for passed and failed features, and each output feature is supplied with attributes that detail the results for each test.
