FME Feature Functions

One other item in the menu of both text and arithmetic editors is FME Feature Functions:


.1 UPDATE
The Timestamp function is deprecated in 2017.1 (see below for more information).

These are functions that reach into the very heart of FME's core functionality. They are the building blocks that transformers are built upon; basic functionality that can return values to the editor.

For example, the @Area() function returns the area of the current feature (assuming it is a polygon). @NumCoords() returns the number of vertices in the current feature.

Some functions return strings, others return numeric values; therefore the available functions vary depending on whether the text or arithmetic editor is being used. In the screenshot above, the text editor functions are on the left and the arithmetic editor functions on the right.

FME Feature Functions are useful because they allow you to build processing directly into attribute creation, instead of using a separate transformer.


Professor Lynn Guistic says…
You might also be wondering why there are math functions inside the text editor and how you can use them.

Well, sometimes you need to calculate a numeric value as part of a string. If so, you can use the FME function @Evaluate() inside a text editor to carry out a mathematical calculation. This function understands all numerical operations, which is why they are included in the text editor dialog.

NEW
New for FME2017 are a series of Date/Time functions:



These functions allow you to calculate results for various date operations; for example you can determine the interval between two dates in a number of units, you can add or subtract time from a date, or you can change a date from one structure to another.

The DataTimeNow function should be used instead of the Timestamp function. FME2017.1 also includes new functions TimeZoneGet, TimeZoneSet, and TimeZoneRemove.

Replacing Other Transformers

Integrated text and arithmetic editors provide a great benefit for workspace creation. They allow attribute-creating functions to be carried out directly in a single transformer.

For example, the AttributeManager text editor can be used as a direct replacement for the StringConcatenator and ExpressionEvaluator transformers.

The AttributeManager could also replace the StringPadder and AttributeTrimmer transformers, albeit with a little less user-friendliness. If FME Feature Functions are used inside the editor, this transformer could also technically replace transformers such as the AreaCalculator, LengthCalculator, CoordinateCounter, TimeStamper, and many more.

This is usually a good thing. Workspaces will be more compact and well-defined when as many peripheral operations as possible are directly integrated into a single transformer. However, because it's possible for an AttributeManager to be carrying out one of many, many operations, it is also more important to use Best Practice and ensure it has proper annotation.

If an AttributeManager is not properly annotated, it isn't possible to determine from looking at the Workbench canvas what action it is carrying out!


Professor Lynn Guistic says…
Note that incorporating functions into a single transformer is not intended as a way to improve performance.

For example, replacing twenty (20) transformers with twenty functions inside one AttributeManager transformer is not going to make the workspace faster overall, and the AttributeManager will obviously become slower with each new function that is added to it.

results matching ""

    No results matching ""