Friday, November 20, 2009

Flagging dangles (free end points) with FME

FME has many transformers that you can mix and match to perform almost any kind of spatial data validation. A common task in data validation is to identify unconnected end points (commonly known as dangles or free end points) in the line work. In the sample data shown below, there are 5 dangles among the 8 vertices of the line work.

To get FME to identify the dangles, I used the Workbench to define the following transformation.

The steps are described below.
  1. Start the FME Workbench and open a blank workspace.

  2. Select Source Data > Add Dataset to add in a source dataset.

    For this example, I added in a ESRI shape file as the source dataset.

  3. Select Destination Data > Add dataset to add in a destination dataset.

    I chose to output the dangle flags as ESRI Shape point file.

  4. Drag and drop the following transformers onto the workbench:
    - CoordinateFetcher (2 times)
    - GeometryRemover
    - 2DPointAdder
    - Matcher

  5. Connect the transformers with the source and destination datasets as shown below.

  6. Open up the first CoordinateFetcher's properties.In the Index field, type in 0. Click OK.

    Note: this transformer will extract the line work's first vertex into the fields _x, _y, and _z.

  7. Open up the second CoordinateFetcher's properties. In the Index field, type in -1. Click OK.

    Note: this transformer will extract the last vertex of the line feature into the fields _x, _y, _z.

  8. Open up the 2DPointAdder transformer's properties. In the X-Value field, choose _x. In the Y-Value field, choose _y. Click OK.

    Note: the 2DPointAdder will create a new point from the _x and _y fields.

  9. Open up the Matcher transformer's properties.In the Match Geometry field, choose 2D.

    Note: In this example, in the Attribute(s) to match field, I chose _x, _y but this is redundant because the 2D point geometry already has the _x and _y coordinates. This field can be left blank.

  10. Run the translation.

    The dangles are created and flagged as red crosses below.

No comments:

Related Posts with Thumbnails