Thursday, October 22, 2009

Fixing linework intersections using FME's Intersector transformer



I am looking into using FME for performing data validation and quality assurance of some digitized line work. I found a  rich set of transformers for this purpose. One of the data cleaning task that I want to do is to break the line work at the point of intersection. The transformers that can do this are the Intersector and the MRFClean transformers. A more specialized variant of the Intersector is the SelfIntersector transformer.

I gave the Intersector transformer a try on a test case shape file dataset.. I put in a few cases: (1) a self-intersecting line, (2) two intersecting lines, and (3) two overlapping or duplicate lines as shown below.

The Intersector transformer has a few options. For self-intersecting line work, you have the option of getting the transformer to break the line work for you or you can leave it as it is. I would prefer to delegate the breaking of the self-intersecting line work to the SelfIntersector transformer as I would be able to differentiate it from the other cases.

For line work with overlapping segments, the Intersector transformer has the option to output as a merged line work or as separate segments. I would prefer the merge option.

To fix the digitized line work using the Intersector transformer, I used the following steps.
  1. Start up the FME Workbench and choose to use the Workspace Wizard.

  2. In the Wizard, specify ESRI Shape as the source format and choose the input shape file.

  3. Specify ESRI Shape as the destination format

  4. Drag the Intersector transformer from the Transformers pane onto the Main pane. Connect the transformer with the source dataset and the dataset as shown in the screen shot below.



  5. Open up the Destination dataset's Feature Type Properties.Click User Attributes tab. Add in 2 number attributes - _overlaps and _segments as shown below. Click OK.


  6. Open up the Intersector's Parameters. Review the parameters. Click OK.



    Note 1: If Split Self-Intersecting Features is set to No, then self-intersecting line work will not be fixed.
    Note 2: If Separate Collinear Segments is set to No, then overlapping segments in the line work will be fixed and merged
    .

  7. Run the translation.

    The dataset is transformed and fixed.
The results are shown in the screenshots below. 
For the overlapping segments, the Intersector has merged into a single geometry. The _overlaps attribute is set to 2 since 2 overlapping segments were merged into 1. 


For intersecting line work, the Intersector transformer has broken them up into separate segments at the point of intersection. For each segment, the _segments attribute is set to 2 for the number of segments created.



The self-intersecting geometry is left as it is - unfixed because the relevant Intersector parameter was set to No.
The Intersector transformer works quite well for my purpose. It also works on polygon line work as well as 3-D datasets. For 3-D line work, it will optionally create one or two nodes at the point of intersection. The only thing left for me to do is to create some mapping file and scripts to generalize the source and destination dataset definitions.

1 comment:

Anonymous said...

Nice Post keep on going.
Thanks