Sample and Demos

Creating a Unique Identifier | CRCCalculator

Article Number: 000001412 - Last Modified: Jun 24, 2015

The CRCCalculator can be used to create unique IDs based on a natural key or a combination of feature attributes and feature geometry.

Description

The CRCCalculator creates a unique ID for a feature based on its geometry and/or attributes. CRC stands for Cyclic Redundancy Check. This is particularly useful if the dataset has a "natural key" -  http://en.wikipedia.org/wiki/Natural_key. Natural keys are created from a list of attribute names and their values for a particular data record or feature. These can be cumbersome to work with in an FME workflow (i.e. FeatureMerger) so combining the natural key into a single CRC unique ID can simplify the workspace.

Another use case is to use the CRC value for change detection - 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).

The value could also be used as a guaranteed unique ID number within a dataset.

Example

The attached workspace shows an example use of the CRCCalculator transformer.

The CRCCalculator is a great tool for carrying out change detection.

In this example, address records are checked against an updated database using CRC values as identification whether a record has been changed. This workspace generates CRC values on-the-fly; an alternative is to save CRC values for each record, to save having to generate them for each run of the workspace. This is the big advantage of using the CRCCalculator over the ChangeDetector.

 

Workspace Screenshot

User-added image
 

Suggested Similar Articles

Create a simple 3D model from extruded 2D CAD data. The results can be displayed in Google Earth after writing them to a KML file.

This example demonstrates an advanced Building Information Model (BIM) translation to GIS. Specifically, reads from LOD 200 IFC and transforms this to an LOD3 CityGML document.

Some basic approaches for how to add to and manipulate the appearance of 3D data, including raster texture overlay and color styling of solids. This model reads 3D buildings from CAD, uses point cloud from LAS to generate terrain, adds appearance textures from GeoTIFF ortho photos and then styles the buildings by height before writing to 3D PDF.

This example shows how to remove intersections from line networks by joining lines based on the angle between segments. The NetworkTopologyCalculator and TopologyBuilder transformers are used for this kind of processing.

Automatically harvest metadata from source MapInfo TAB files and write out one ISO19115 xml metadata document for each input file. This is only meant as a demo and therefore the metadata generated is only partially populated.