Introduction
The FeatureReader transformer is one that acts – as the name suggests – as a reader in itself. Each incoming feature triggers a query to a database (or any dataset) that can include both spatial and non-spatial data. This way, queries can run mid-translation, rather than through Reader parameters.
Incoming features are known as Initiators. Each initiator feature triggers a single query through the reader. The query can be an attribute query, a spatial query, or a combination of the two.
For a spatial query, the initiator feature's geometry is used with different spatial predicates, and the reader returns one or more features as the result. For example, an area bounding polygon (i.e., municipal boundary) could be used to extract all postal addresses inside that area. Or an incoming line feature (maybe a road) can define the base for an intersection query against linear database features such as rivers or rail.
In addition, the FeatureReader can support non-spatial queries. The Initiator feature may have an attribute you can use in a WHERE clause against the data to be read. In this case, ensure the attribute is indexed, as this has a major impact on FeatureReader performance.
FeatureReader has options on how attributes from the Initiator features are merged onto the result features. The FeatureReader can have multiple output ports, each returning different features depending on how the transformer is configured. The full details on all the functionality offered by the FeatureReader are in the Documentation.
Below are example workspaces showing the kinds of tasks the FeatureReader transformer can perform.
Articles
Performing Spatial Queries Against Database Tables Using FeatureReader
The SQLExecutor can also do this; however, FeatureReader requires no SQL knowledge.
Extracting Data with a Clipping Polygon Using FeatureReader
A simple example of how to set up a workflow to extract data in user-specified layers that fall within a given polygon.
How to Read Multiple Feature Classes from Multiple Geodatabases
This example uses FeatureReader to read and translate all feature classes from multiple geodatabases, regardless of which feature classes are present.