CRCCalculator
Calculates a CRC (Cyclic Redundancy Check) value for a feature and places the calculated CRC value into the attribute specified.
If a CRC is calculated for both coordinates and attributes, it is returned as a hexadecimal string representing an integer of double the bit-length of the chosen algorithm. If a CRC is calculated for only coordinates or only attributes, it is returned as a hexadecimal string representing an integer equal to the algorithm bit-length.
The output format is xxxxxxxxyyyyyyyy, where the x's represent the CRC calculated for coordinates, and the y's represent the CRC calculated for attributes.
Input Ports
Features to calculate a CRC value for.
Output Ports
Features with the calculated CRC value.
Features will be output through this port if the Calculate CRC On parameter is File, and the file path is incorrect.
Parameters
The algorithm chosen will determine the parameters used for the CRC calculation based on CRC standards.
These standards can be found at: http://reveng.sourceforge.net/crc-catalogue/
The algorithms to choose from are:
- CRC-16-CCITT-FALSE
- CRC-16-XMODEM
- CRC-16-ARC
- CRC-32
- CRC-32-Q
- MD5
The attribute that will hold the CRC calculation result.
The CRC can be calculated on either Coordinates and Selected Attributes, Coordinates and All Attributes, Selected Attributes Only, All Attributes Only, or File. Coordinates refers to the coordinates of the geometries of input features.
If Coordinates and Selected Attributes is specified, the CRC will be calculated on the coordinates and the values of the attributes the user has selected in the Selected Attributes parameter.
If Coordinates and All Attributes is specified, the CRC will be calculated on the coordinates and the values of all the attributes on the feature.
For both of the above options, if no attributes with a value are found, the calculated CRC will be based only on the feature's coordinates. If no coordinates or attributes are found, 0 is returned.
If Selected Attributes Only is specified, the CRC will be calculated on the values of the attributes the user has selected in the Selected Attributes parameter.
If All Attributes Only is specified, the CRC will be calculated on the values of all the attributes on the feature.
For Selected Attributes Only and All Attributes Only options, if no attributes with a value are found, the output CRC value is 0
If File is specified, the CRC will be calculated on the contents of the file specified in the Filename parameter. If the file can not be found, the feature will be rejected.
When Calculate CRC On is set to File, this parameter is used to specify the file to calculate the CRC value for.
If Calculate CRC On is set to Coordinates and Selected Attributes or Selected Attributes Only, this parameter indicates the attributes to use in the CRC calculation.
Usage Notes
You can use this CRC value to check data at a later date - to make sure it hasn't been changed, corrupted, deleted etc. It can also be used as a form of ChangeDetection (instead of using the ChangeDetector to compare geometry, use the Matcher to compare CRC values).
Like all popular CRC algorithms, different features could produce the same CRC value with minimal probability.
Example
This FME Community example shows an advantage to using the CRCCalculator over the ChangeDetector.
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Transformer Categories
Technical History
Associated FME function or factory: @CRC
Search FME Community
Search for samples and information about this transformer on the FME Community.