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?


No comments:

Post a Comment