GeometryCoercer

From Fmepedia

GeometryCoercer is a Workbench Transformer.


A GeometryCoercer changes the geometry type of the input features to either fme_point, fme_line or fme_polygon. This only works on simple features, donuts or aggregates are output untouched.

Depending on the original geometry, this transformer may have no effect:

  • If an attempt is made to set the feature’s geometry type to fme_point and the feature has more than one coordinate, then the feature’s geometry type is unchanged.
  • If an attempt is made to set the feature’s geometry type to fme_polygon and the feature has more than one coordinate, then the first coordinate and the last coordinate must be the same or the feature’s geometry type will be unchanged.
  • If an attempt is made to set the feature’s geometry type to fme_line or fme_polygon and the feature had only one coordinate, then the feature’s geometry type is unchanged.

This transformer is sometimes used to have area features treated as though they were linear features, either because some later processing requires lines, or the destination format represents lines different than polygons and the linear representation is desired.


NB: Donut Polygons

The GeometryCoercer can't be directly used to convert donut polygons to lines. If you need to do this, extract the donut parts first using the DonutHoleExtractor.



Example

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

In this example a polygon feature is coerced into a line, and then back into a polygon. Labels (text features) are coerced into simple point features.


Workspace Screenshot


Output Screenshot

Attached Files
filesizedate
GeometryCoercer Example Output.jpg18.5 kB11/11/08
GeometryCoercer Example.jpg110.7 kB11/11/08
GeometryCoercer Example.zip100.3 kB11/11/08
main.php------
User Comments Add a new comment