FME Transformers: 2024.1
FME Transformers: 2024.1
Tiler
Splits input features into a series of tiles by specifying either tile size (in ground units) or total number of tiles.
Typical Uses
-
Tiling data for storage or processing efficiency
-
Tiling data to match the extents of other datasets to enable group processing
How does it work?
The Tiler accepts features with most types of geometry, including vector, raster, and point cloud. 2D and 3D features are supported. The input features are divided into a series of rectangular tiles, according to parameter selections.
The extent of each tile may be described by:
-
Dimensions in Ground Units - where the height and width of the tiles are specified explicitly in the ground units of the features’ coordinate system, or
-
Number of Tiles - where the bounding box encompassing all features is divided by the specified number of columns and rows.
Features receive Column and Row number attributes identifying the tile they fall within. Columns and rows are numbered from zero (0) and the numbering may start in any corner.
Features are split where they cross tile boundaries. Elements that fall on tile borders may be duplicated in each tile.
Seed coordinates can be used to control tile position when Define Tiles By is Dimensions in Ground Units.
3D features are tiled as they overlay the 2D tiles. Where they are split, z values may be interpolated in a variety of ways. Measures may also be interpolated where required.
RasterTiler or Tiler?
The RasterTiler also tiles rasters, and may be appropriate if you wish to tile based on number of cells (pixels) per tile. This table compares the two:
Tiler | RasterTiler | |
---|---|---|
Tiling extents |
Cumulative over all features |
Single feature |
Type of data accepted |
All types except surfaces and solids |
Raster only |
Tile size units |
Ground coordinates |
Pixel coordinates |
Tile row numbering (0, 1,...) |
Selectable |
Top to bottom |
Supports forcing equal-size tiles |
No |
Yes |
Supports raster index attribute |
No |
Yes |
Supports number of horizontal/vertical tiles attribute |
No |
Yes |
Examples
Example: Tiling features by number of tiles
In this example, we have a set of neighborhood polygons and want to divide them into four tiles.
Note the shape of the selected neighborhood.
The features are routed into a Tiler.
In the parameters dialog, Define Tiles By is Number of Tiles, and Columns and Rows are both set to 2.
Note that the defaults have column and row numbering starting from the lower left corner, with numbers added to new _column and _rowattributes.
To better illustrate the tiling, the features are assigned colors according to their column and row numbers with a FeatureColorSetter.
The output features have been tiled, receiving row and column numbers. Features that cross a tile boundary, such as the neighborhood selected above, are split. Both parts keep their original attributes and receive different row and/or column numbers as appropriate.
Example: Using tile size and seed coordinates to control tile position
In this example, we will tile a set of transit line features using a specific tile size. We want the resulting tiles to align with a separately-generated grid. Seed coordinates will be used to control the position.
Note that the features are in a UTM83-10 coordinate system, with ground units in meters.
The features are routed into a Tiler.
In the parameters dialog, Define Tiles By is Dimensions in Ground Units. Both the Width and Height are set to 1000 meters.
The Seed Coordinates are also set to 1000, which ensures the tile corners are placed predictably at coordinates that are multiples of 1000, rather than starting wherever the extents of the features fall.
To better illustrate the tiling, the features are assigned colors according to their column and row numbers with a FeatureColorSetter.
The output features have been tiled, receiving row and column numbers.
The tiled features align spatially with a grid generated separately with a 2DGridCreator, using a 1000-meter interval over a larger area than the transit lines’ extents.
Note the Min and Max Extents values for the grid cell - whole numbers, multiples of 1000. The tile boundaries fall on the same coordinates.
Usage Notes
-
Features in a latitude/longitude coordinate system may need to be reprojected prior to tiling. Consider using the Reprojector or other reprojection transformers. For temporary reprojection for defined tile size, the CommonLocalReprojector may be useful.
-
The Tiler does not create grid. For grid, see the 2DGridAccumulator or 2DGridCreator.
Creating Boxes and Rectangles
Creating rectangular geometry is a common task. These transformers do so in a variety of ways.
Rectangle Transformers Comparison
Transformer |
Function |
---|---|
Creates one or more new features with box geometry of a specific size and position (when Geometry Object is Box). |
|
Replaces an existing feature’s geometry with a box of a specific size and position. |
|
Creates one rectangle that encompasses all features received. |
|
Individually replaces the geometry of each feature with a rectangle that covers its extents. |
|
Individually replaces the geometry of each raster feature with a rectangle that covers its extents (with various Extents Type options). |
|
Extracts the coordinate values that describe an individual feature’s bounding box (or cube) and stores them as attributes. |
|
Creates a series of regularly-spaced rectangles that span the extent of all features received (when Type of Grid to Create is Polygons). |
|
Creates a series of regularly-spaced rectangles of a specific size and position (when Type of Grid to Create is Polygons). |
|
Tiler and RasterTiler |
Do not create actual rectangles, but chop features into a series of rectangular tiles, specified in a similar fashion to the 2DGridAccumulator. |
Configuration
Input Ports
Input
Features with geometry to be tiled. Point, curve, area, surface, solid, raster, and point cloud geometries are supported.
Output Ports
Tiled
Features tiled as specified in parameters.
Remnants
Any geometries that were unused during tiling.
<Rejected>
Features without valid geometry are output via this port, as are features that are invalid in a way that prevents tiling - a geometry that extends to infinity, for example.
The Invalid Parts Handling parameter determines what is output through the port.
If Reject Parts Only is selected then only the parts that caused the feature to be invalid will be output through the <Rejected> port.
If Reject Whole Feature is selected the entire feature will be output through the <Rejected>port.
Rejected features will have an fme_rejection_code attribute with one of the following values:
INVALID_PARAMETER_TILE_WIDTH
INVALID_PARAMETER_TILE_HEIGHT
INVALID_PARAMETER_SEED_COORDINATE_X
INVALID_PARAMETER_SEED_COORDINATE_Y
INVALID_PARAMETER_NUMBER_OF_HORIZONTAL_TILES
INVALID_PARAMETER_NUMBER_OF_VERTICAL_TILES
INVALID_GEOMETRY_NON_SPATIAL
INVALID_GEOMETRY_NOT_FINITE
INVALID_GEOMETRY_TYPE
Rejected Feature Handling: can be set to either terminate the translation or continue running when it encounters a rejected feature. This setting is available both as a default FME option and as a workspace parameter.
Parameters
Group Processing
Group By |
The input features may be partitioned into groups based on attribute values. One tiling operation is performed for each group. If Group By is not specified, all input features will be processed together. |
||||
Complete Groups |
Select the point in processing at which groups are processed:
Considerations for Using Group By
There are two typical reasons for using When Group Changes (Advanced) . The first is incoming data that is intended to be processed in groups (and is already so ordered). In this case, the structure dictates Group By usage - not performance considerations. The second possible reason is potential performance gains. Performance gains are most likely when the data is already sorted (or read using a SQL ORDER BY statement) since less work is required of FME. If the data needs ordering, it can be sorted in the workspace (though the added processing overhead may negate any gains). Sorting becomes more difficult according to the number of data streams. Multiple streams of data could be almost impossible to sort into the correct order, since all features matching a Group By value need to arrive before any features (of any feature type or dataset) belonging to the next group. In this case, using Group By with When All Features Received may be the equivalent and simpler approach. Note Multiple feature types and features from multiple datasets will not generally naturally occur in the correct order.
As with many scenarios, testing different approaches in your workspace with your data is the only definitive way to identify performance gains. |
General
Define Tiles By |
Select a tile sizing method:
|
||||||||
Starting Corner |
Select the corner for the origin of the tiling. Column and row numbering starts at 0,0. When Define Tiles By is Dimensions in Ground Units, the last column and/or row may extend beyond the bounding box of the input features. The last column/row is opposite the selected Starting Corner. |
||||||||
Dimensions in Ground Units |
When Define Tiles By is Dimensions in Ground Units:
If any of these values are supplied via an attribute or expression, the values used are taken from the first encountered feature of the group. Values from subsequent features are ignored When tiling rasters without coordinate systems or georeferencing, ground units are one (1) per cell and the origin is 0,0. |
||||||||
Number of Tiles |
When Define Tiles By is Number of Tiles:
If any of these values are supplied via an attribute or expression, the values used are taken from the first encountered feature of the group. Values from subsequent features are ignored |
Advanced
Tolerance |
Specify the minimum distance between geometries in 2D before they are considered equal, in ground units:
|
||||
Duplicate Elements on Tile Borders |
Features on the border between tiles may be duplicated so that they appear in both tiles:
|
||||
Missing Z Values |
Select a method for interpolating z values required after tiling:
|
||||
Missing Measure Values |
Select a method for handling features that have some measures, but are missing at least one value after tiling:
If no value is given for a measure, the measure will be removed. |
||||
Invalid Parts Handling |
If a feature has geometry with an invalid part:
|
||||
Preserve Feature Order |
This parameter controls the order in which features exit a transformer. When a transformer has more than one output port, features usually exit one port at a time. At times, it may be useful to keep the order that features arrived in, switching from port to port as necessary. This allows feature order to be preserved, though at a potential cost in processing efficiency. Select a method for feature ordering.
|
Output Attribute Names
Column |
Name the attribute to contain column numbers, relative to the Starting Corner. Numbering starts with 0. |
Row |
Name the attribute to contain row numbers, relative to the Starting Corner. Numbering starts with 0. |
Editing Transformer Parameters
Transformer parameters can be set by directly entering values, using expressions, or referencing other elements in the workspace such as attribute values or user parameters. Various editors and context menus are available to assist. To see what is available, click beside the applicable parameter.
How to Set Parameter Values
Defining Values
There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters.
Using the Text Editor
The Text Editor provides a convenient way to construct text strings (including regular expressions) from various data sources, such as attributes, parameters, and constants, where the result is used directly inside a parameter.
Using the Arithmetic Editor
The Arithmetic Editor provides a convenient way to construct math expressions from various data sources, such as attributes, parameters, and feature functions, where the result is used directly inside a parameter.
Conditional Values
Set values depending on one or more test conditions that either pass or fail.
Parameter Condition Definition Dialog
Content
Expressions and strings can include a number of functions, characters, parameters, and more.
When setting values - whether entered directly in a parameter or constructed using one of the editors - strings and expressions containing String, Math, Date/Time or FME Feature Functions will have those functions evaluated. Therefore, the names of these functions (in the form @<function_name>) should not be used as literal string values.
Content Types
These functions manipulate and format strings. | |
Special Characters |
A set of control characters is available in the Text Editor. |
Math functions are available in both editors. | |
Date/Time Functions | Date and time functions are available in the Text Editor. |
These operators are available in the Arithmetic Editor. | |
These return primarily feature-specific values. | |
FME and workspace-specific parameters may be used. | |
Creating and Modifying User Parameters | Create your own editable parameters. |
Dialog Options - Tables
Table Tools
Transformers with table-style parameters have additional tools for populating and manipulating values.
Row Reordering
|
Enabled once you have clicked on a row item. Choices include:
|
Cut, Copy, and Paste
|
Enabled once you have clicked on a row item. Choices include:
Cut, copy, and paste may be used within a transformer, or between transformers. |
Filter
|
Start typing a string, and the matrix will only display rows matching those characters. Searches all columns. This only affects the display of attributes within the transformer - it does not alter which attributes are output. |
Import
|
Import populates the table with a set of new attributes read from a dataset. Specific application varies between transformers. |
Reset/Refresh
|
Generally resets the table to its initial state, and may provide additional options to remove invalid entries. Behavior varies between transformers. |
Note: Not all tools are available in all transformers.
For more information, see Transformer Parameter Menu Options.
Reference
Processing Behavior |
|
Feature Holding |
Yes |
Dependencies | None |
Aliases | |
History |
FME Community
The FME Community is the place for demos, how-tos, articles, FAQs, and more. Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.
Search for all results about the Tiler on the FME Community.
Examples may contain information licensed under the Open Government Licence – Vancouver, Open Government Licence - British Columbia, and/or Open Government Licence – Canada.
Keywords: raster grid clip subset tile extent bound limit Tessellate Tessellation pointcloud