Skip to main content

Posting these Custom Transformers that may be of use or further developed:

  • FeatureCreator
  • FeatureExecutor

 

One thing that is tedious in FME is actually creating data within the workspace itself.  FME’s use case is mainly aimed at transforming external data and so is not natively setup towards actually creating new rows of data from scratch within the workspace itself.

Wouldn’t it be nice if instead, users could just copy/paste a table of values into tje workspace and it automatically convert these to Features for you?  ie. Easily store a “table” of data within the Workspace?   This is essentially what these Custom Transformers aim to do (and partially inspired by Eg. Power BI with its similar “Transfomer” / Power Query that gives an interface to just copy/paste a table of data from the Clipboard into the query definition)

Probably most of us currently use any number of Creators, Cloners, AttributeCreators (often with Conditional Values), Testers etc. for what is a lot of effort just to create some new scratch Features directly within the Workspace, or otherwise have to put an External Reader out to some other production or temporary data source and have to often setup data externally as an extra step Eg. Temporary Excel files.  The time required to create these does add up and makes some workspaces cluttered/complex just from all the Transfomers needed to create a scratch “Table” of Features within FME itself.

These Custom Transformers aim to solve that by giving a plain text box for users to type delimited rows of data in (or even better copy/paste an Excel table from the clipboard into FME or from whatever other software/program will allow copy/paste of a table of data)

FeatureCreator and FeatureExecutor even supports Geometry creation on each row of data. The user can type or copy/pastes in Well Known Text (WKT) as an easy way to construct different geometries within the one workspace table, and this similarly makes it possible to copy/paste data out of SQL interfaces to spatial databases since most support a WKT AsText() type function to get the WKT text.

There are some secondary uses as well, where the FeatureExecutor can also be used to Cross Join a fixed table of text values to incoming Initiator Features by merging the incoming Feature Attributes with a in-workspace table of data (by internally using a FeatureJoiner)

These are very dynamic Transformers and I would not say they are totally bug free, but so far, when used sensibly, they seem to work for me on sample data, and even begun to use them to shorten the amount of time needed to create sample Features from examples put up by other users in their Forum posts.

Enjoy 😉


FeatureCreator

 

 

FeatureExecutor

This screenshot alternatively for this example will copy/paste in some Excel data into the FeatureExecutor tabular data text box.  Note FeatureExecutor and FeatureCreator are essentially the same internally, but FeatureExecutor we send our own initiating features to the Transformer whereas this is simplified in FeatureCreator

First Copy a Table of Data from Excel onto the Clipboard..

 

Then Paste below into the FeatureExecutor/FeatureCreator Text Box…  (also optionally in this example will set columns “A”,”B”,”C” as output attributes to expose to the Workspace downstream of the Transformer).

Note that the Transformer will “auto-detect” if Tab characters are used as the Delimiter, such as how Excel copies tables/cells to the Windows Clipboard, and override the default “,” setting.

 

This outputs these Features



And if choose to add a “Geometry” Column with WKT data then using same copy/paste (can also manually write the WKT into the Transformer if wish)

 

 

Gives back Spatial/Geometry Features

 

 

Probably not for everyone but I like the idea.

I believe the FME hub is the place to upload these, but I’ve never done that myself so no pointers to how-to’s from me :)


how-to’s: https://docs.safe.com/fme/html/FME-Form-Documentation/FME-ReadersWriters/FME-Hub/Publishing-to-FME-Hub.htm


Reply