IBM Streams 4.2

Operator SpatialRouter

Primitive operator image not displayed. Problem loading file: ../../image/tk$com.ibm.streams.geospatial/op$com.ibm.streams.geospatial$SpatialRouter.svg

The SpatialRouter operator is used to split an input stream that contains geographical data into two or more output streams, based on the geographic location specified by each tuple. It has one input port and any number of output ports can be defined.

Each input tuple is determined to belong to a given region in the geohash system, based on the location specified by its geometry attribute. The cell or region size is configurable using the geohashBitDepth parameter. The higher the number of bits, the smaller the cell size. For more information on Geohashes and how to select the appropriate bit depth, see the Geohashes section in the main page of the documenation for this toolkit.

For each tuple, the geohash is computed using the specified geohashBitDepth. The operator then uses the following calculation to determine to which port the tuple should be forwarded:
first 32 bits of geohash % number of ports

The SpatialRouter can also be configured to submit a tuple to multiple output ports by using the precision parameter.

Behavior in a consistent region

  • The SpatialRouter operator can be an operator within the reachability graph of a consistent region. It cannot be the start of a consistent region.

Summary

Ports
This operator has 1 input port and 1 or more output ports.
Windowing
This operator does not accept any windowing configurations.
Parameters
This operator supports 3 parameters.

Required: geohashBitDepth, precision

Optional: geometry

Metrics
This operator reports 1 metrics.

Properties

Implementation
C++
Threading
Never - Operator never provides a single threaded execution context.

Input Ports

Ports (0)

This operator has 1 input port. Each valid input tuple is routed to at least one output port. It is possible that an input tuple might be submitted to multiple ports if its distance from a region that corresponds to a different port is less than the value of the precision parameter. If an input tuple contains invalid data, it is ignored. Invalid tuples are tracked in the metric nFailedTuples.

Properties

Output Ports

Assignments
This operator does not allow assignments to output attributes.
Ports (0...)

This operator is configurable with one or more output ports.

Properties

Parameters

This operator supports 3 parameters.

Required: geohashBitDepth, precision

Optional: geometry

geohashBitDepth

Parameter that defines the size of the geohash cells. The larger the value, the smaller the size of each individual cell. The minimum and maximum values for this parameter are 5 and 64 respectively. These, in turn, result in geohash cells ranging in size from 2500km x 2500km to 9.4mmx9.4mm. If the value specified is greater or lower than these values, the appropriate minimum or maximum value is used instead. This parameter must be specified at compile or submission time.

Properties

geometry

Attribute containing the geometry on which the split is performed. If this attribute is omitted, it is assumed that an attribute named geometry exists on the input stream.

Properties

precision

This parameter specifies, in meters, the accuracy of the incoming data. The minimum value is 0.0. A value of 0.0 means that the data is highly precise. When greater than 0, this value is the size of the overlap region between neighboring bounding boxes. For example, a value of 10 means that the data is accurate to 10 meters. Thus, if an object is located within 10 meters of the boundary between its cell and a nearby cell, it will be deemed to be a member of that nearby cell as well. This could then result in object being forwarded to more than one port, if both cells correspond to different output ports. This parameter must be specified at compile time or submission time.

Properties

Metrics

nTuplesFailed - Counter

The number of tuples that failed to route

Libraries

Spatiotemporal library
Library Name: st
Library Path: ../../impl/lib
Include Path: ../../impl/include/st
PROJ4 library
Library Name: proj
Library Path: ../../impl/lib/external/proj4
Include Path: ../../impl/include/external