Friday, October 11, 2013

FME Template




The ability to save workspaces as templates was added in FME 2011.
If you keep preforming the same actions, for example use a reader's bounding box settings, then this is something you should consider.

A template is basically a saved workspace, in which you can have as many transformers and readers in it as you like or none at all.
None at all? well yes actually the one I use the most doesn't have any transformers (yet) and only one reader and an inspector.

If you are a heavy database user then consider the following:
  • You constantly need to access data from different services with different users/passwords and you want a to spatially select the data and tables from where the data comes from.

You can create a workspace from scratch each time, but if you hate repetitive and not particularity efficient tasks (like me) then a template can save you lots of time (which you can spend on the fun part = transformation)

To make the template as flexible as possible I make use of many parameters (private and published).
These parameters assist me to define the database service, user name, password, feature types (tables), where clause and location (bounding box) when running the workspace (prompt and run)

Prompt window

The only action I actually have to do is to select my translation source parameters and run, viola!

Wednesday, October 9, 2013

Search feature

As a seasoned FME user you are probably aware of the fact that a reader's bounding box coordinates settings are an efficient way to read only data which is spatially relevant for your location.

A little less known option, native to the FME  ESRI database readers (SDE and Arc Objects GDB  is the search feature. This option lets you use the reader (actually the underlaying database) to preform a selection of spatial selection based on a feature.

To make use of this functionality requires a little bit of preprocessing if you don't have the search features in the necessary format.
Let's take an example to make this clear.
  • Lets say you have projects boundaries polygons available (doesn't matter in which format since FME is the champion of formats) and you want to use these features as a search feature on data in an SDE or GDB database.
  • You basically need to convert your boundaries into the format accepted by the search feature setting (space delimited coordinates)
  • This can be easily done with FME (see the CoordinateConcatenator transformer >FME 2013)
What I ended up with is a space delimited csv file:
Search features read by the csv reader

  • Now it is time to implement it on the database reader, go to the Navigator> Parameters > Advanced > Search feature
  • Create a parameter from the setting (right click > Create user parameter), select choice with alias (multiple).
  • In the parameter's configuration setting select the import option, this will basically open a wizard (much the same as a normal reader) in which you can select the csv file created.
  • Make sure you correctly select the values and alias fields and you will end up with a selection menu for the search feature.

Selection of search features when prompting

As the name of the setting suggests you can only select one feature, and if you intend to have a selection from multiple features: the FeatureReader is the way to go.

You might think 'pfff.... I can use the FeatureReader ' well you can!! as in all things FME there are many roads that lead to the desired results but since this functionality exists, why not make use of it?


Tuesday, October 8, 2013

XML



I used to be a bit cautious when dealing with XML in the past, but since I have started using FME with it, it just broke down all the barriers.

I actually find it to be a very exiting data type to work with, it is simple to understand and with FME (what else) it is simple to update, create and completely transform.

There is a all bunch of FME transformers for dealing with XML in the transformer gallery.
















I have to admit that I only use a couple of them on a regular basis (XMLTemplater, XMLFormatter and the XMLValidatior) which ,as the names suggest, help me to create, validate and make then human readable.

I guess that Don's love and enthusiasm for XML has affected me too!