MapnikRasterizer
Draws input point, line, polygon, and raster features onto a raster using the Mapnik toolkit.
Mapnik divides features into groups called layers. Features in a layer should share the same geometry type. For each layer, one or more symbolizers will be defined; these represent a set of parameters that describe how to render the features. For example, a layer could be a set of lines representing country borders. This layer could then have two symbolizers -- one to draw the lines, and a second one to draw a "glow" surrounding the lines.
Input Ports
This transformer will have one input port for each layer. Layers are defined using the Inputs parameter.
Output Ports
The raster(s) drawn from a group of features.
Invalid features that will not be included in the output raster.
Parameters
Transformer
If the Group By parameter is set to an attribute list, one raster per group will be produced.
Note: How parallel processing works with FME: see About Parallel Processing for detailed information.
This parameter determines whether or not the transformer should perform the work across parallel processes. If it is enabled, a process will be launched for each group specified by the Group By parameter.
Parallel Processing Levels
For example, on a quad-core machine, minimal parallelism will result in two simultaneous FME processes. Extreme parallelism on an 8-core machine would result in 16 simultaneous processes.
You can experiment with this feature and view the information in the Windows Task Manager and the Workbench Log window.
No: This is the default behavior. Processing will only occur in this transformer once all input is present.
By Group: This transformer will process input groups in order. Changes of the value of the Group By parameter on the input stream will trigger batch processing on the currently accumulating group. This will improve overall speed if groups are large/complex, but could cause undesired behavior if input groups are not truly ordered.
Using Ordered input can provide performance gains in some scenarios, however, it is not always preferable, or even possible. Consider the following when using it, with both one- and two-input transformers.
Single Datasets/Feature Types: Are generally the optimal candidates for Ordered processing. If you know that the dataset is correctly ordered by the Group By attribute, using Input is Ordered By can improve performance, depending on the size and complexity of the data.
If the input is coming from a database, using ORDER BY in a SQL statement to have the database pre-order the data can be an extremely effective way to improve performance. Consider using a Database Readers with a SQL statement, or the SQLCreator transformer.
Multiple Datasets/Feature Types: 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, using Ordering with multiple feature types is more complicated than processing a single feature type.
Multiple feature types and features from multiple datasets will not generally naturally occur in the correct order.
One approach is to send all features through a Sorter, sorting on the expected Group By attribute. The Sorter is a feature-holding transformer, collecting all input features, performing the sort, and then releasing them all. They can then be sent through an appropriate filter (TestFilter, AttributeFilter, GeometryFilter, or others), which are not feature-holding, and will release the features one at a time to the transformer using Input is Ordered By, now in the expected order.
The processing overhead of sorting and filtering may negate the performance gains you will get from using Input is Ordered By. In this case, using Group By without using Input is Ordered By may be the equivalent and simpler approach.
In all cases when using Input is Ordered By, if you are not sure that the incoming features are properly ordered, they should be sorted (if a single feature type), or sorted and then filtered (for more than one feature or geometry type).
As with many scenarios, testing different approaches in your workspace with your data is the only definitive way to identify performance gains.
Rendering Rules
Defines the layers and symbolizers that specify how features will be rendered.
Each entry in the table contains an input port, a symbolizer type, and the parameters for that symbolizer. The symbolizer parameters depend on the symbolizer type. Descriptions of the parameters for each symbolizer may be found in the Mapnik documentation.
Note that layers will be rendered in the order they are specified. The first layer in this table will be rendered first (i.e. will appear below any subsequent layers).
This parameter specifies what defines a layer.
When set to Each rendering rule is a layer, each individual rule in the above table will be rendered as a separate layer.
When set to Each input port is a layer, each input port will be rendered as a layer. Note that some layers will contain multiple symbolizers in this case.
Essentially, this determines the draw order of the rendering rules. Layers are rendered in order, with all features for a layer drawn before any features of the next layer. Within a layer, symbolizers are applied feature-by-feature.
Example: You have line features representing streets, and each feature also contains an attribute specifying the street name. To render this, you could set up a Line symbolizer and a Text symbolizer. In this case, you would want to draw all the streets first, then have all the labels on top of those, so Each rendering rule is a layer would be more appropriate.
Example: You have overlapping polygons, and want to draw each with a border. To render this, you could set up a Polygon symbolizer and a Line symbolizer. In this case, you would want to draw each feature as both a polygon and a line before moving on to the next feature, so Each input port is a layer would be more appropriate.
Note that the behavior of Each rendering rule is a layer can be replicated when Layer Definition is set to Each input port is a layer. To do this, just add a new input port for each separate layer.
Raster Properties
To set the size of the output raster, specify either the dimensions or the cell size.
To set the output raster size using dimensions, set the Size Specification to Columns and Rows and specify values for both the Number of Columns and Number of Rows.
To set the output raster size using spacing, set the Size Specification to Spacing and specify a value for Cell Spacing.
This specifies how many cell columns there are in the output raster. This parameter is used when the Size Specification is Columns and Rows.
This specifies how many cell rows there are in the output raster. This parameter is used when the Size Specification is Columns and Rows.
This parameter specifies the width of the output raster cells, measured in ground units. This parameter is used when the Size Specification is Spacing.
This parameter sets the interpretation of the output raster.
Background
The background may be filled with a solid color and/or image. If neither a color nor image is specified, the background will be transparent.
The Color parameter sets the background color.
Click the colored square to the right of the text field, or edit the contents of the field directly. The color must be specified as <red>,<green>,<blue> where each of <red>, <green>, and <blue> is a number between 0 and 1.
The Color Alpha Value parameter sets the alpha value for the background color. It must be a number between 0 and 1.
This parameter specifies an image file that should be used as the background for the raster.
Ground Extents
If the Ground Extents parameter is set to Use input data ground extents, the output raster extents will be determined by the union of the bounding boxes of the input features.
If the Ground Extents parameter is set to Specify ground extents, the remaining Ground Extents parameters are used to specify the extents of the output raster.
Note that the output raster extents may not be equal to the specified extents if the raster size was specified by the number of rows and columns. This is because the x and y spacing must be equal (i.e. (Maximum X - Minimum X) / Number of Columns must be equal to (Maximum Y - Minimum Y) / Number of Rows). If they are not, the extents may be enlarged in one dimension.
This specifies the minimum x value of the output raster. It is used when the Ground Extents parameter is set to Specify ground extents.
This specifies the minimum y value of the output raster. It is used when the Ground Extents parameter is set to Specify ground extents.
This specifies the maximum x value of the output raster. It is used when the Ground Extents parameter is set to Specify ground extents.
This specifies the maximum y value of the output raster. It is used when the Ground Extents parameter is set to Specify ground extents.
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Transformer Categories
FME Licensing Level
FME Professional edition and above
Search FME Knowledge Center
Search for samples and information about this transformer on the FME Knowledge Center.
Tags Keywords: minimum bounding rectangle MBR fme_colour rasteriser