Stream layers are feature layers of live observations. You can adjust how and when those features are shown in a map and scene, and you can interact with their attributes.
Manage the display of streaming observations
In addition to the way you symbolize stream layers, you can control how the live observations are displayed. A stream layer is subscribed to its source stream service, so any observations that are broadcast from that service are displayed as a live stream of information. You can start and stop the stream and discard the observations to clear the map or scene until new observations are broadcast. You can limit the observations that are displayed by setting a definition query, and you can specify how long observations remain visible on the map or scene by setting an observation expiration.
Start and stop streaming
To start or stop the live stream of observations, follow these steps:
- Select a stream layer in the Contents pane.
- On the Stream Layer tab set, click the Data tab.
- On the Data tab, in the Streaming Data group, click Start Stream or Stop Stream .
- To discard the observations to clear the map or scene, click Discard Observations .
Set a definition query
You may want to limit the display of a stream layer to show only certain types of observations. You can filter the observations by setting a definition query. This is similar to setting a definition query on a standard feature layer, but there are a few additional considerations.
Setting a definition query makes a new connection to the stream service, so the display is refreshed and all observations are removed from the map before streaming begins again, based on the query.
When you set a definition query on a stream layer, the filter is applied to the stream service connection, so only observations that meet the query are passed through to the stream layer. This means that you cannot build a query from fields that the stream service is not aware of, such as OBJECTID and SYS_TIMESTAMP.
Valid definition queries are more limited for stream layers than for standard feature layers. You can make comparisons between a field and a literal value (for example, field1 > 1) or between two fields of the same type (for example, field1 > field2). You can add parentheses to make precedence explicitly enforced. The query must be an SQL where clause using only the following operations:
- AND
- OR
- NOT
- =
- !=
- <
- <=
- >
- >=
- IS NULL
- IS NOT NULL
- IN
- LIKE
Follow these steps to set a definition query on a stream layer:
- In the Contents pane, right-click a stream layer and click Properties .
- On the Layer Properties dialog box, on the Definition Query tab, click New definition query.
- In the query builder, choose values from the menus to construct the clause. Optionally, click Add Clause to define additional clauses in the query.
- In the query builder, click Apply to save the definition to the layer.
- On the dialog box, click Apply to review your settings, or click OK to apply all changes and close the dialog box.
Set observation expiration
Streamed observations collect on the map or scene. If there are a lot of observations and they're streaming in quickly, the visual message of your map or scene can become obscured. You can control how many previous observations remain visible on your map by specifying their expiration. You can set a threshold of either the total number of observations you want to collect or the duration at which they'll display.
Follow these steps to set the expiration of observations for a stream layer that is not track-aware:
- Select a stream layer in the Contents pane.
- On the Stream Layer tab set, click the Data tab.
- On the Data tab, in the Streaming Data group, under the Observations Expire After heading, choose one of the following options:
- Max Observations—Specify the total number of observations that will accumulate on the map or scene for that layer.
- Duration—Specify a duration in which observations older than this duration are removed from the map or scene.
Set observation expiration for track-aware stream layers
For a stream layer that is track-aware, you set observation expiry per track instead of for the whole map or scene. Follow these steps to set the expiration of observations on a track-aware stream layer:
- Select a stream layer in the Contents pane.
- On the Stream Layer tab set, click the Data tab.
- On the Data tab, in the Streaming Data group under the Observations Expire After heading, choose one of the following options:
- Max Observations Per Track—Specify the total number of observations that will accumulate for each track.
- Duration Per Track—Specify a duration in which observations on each track older than this duration are removed from the map or scene.
Interact with the streaming observations
In addition to specifying how the stream layer is displayed, you can select and view observation features, and use them as inputs to geoprocessing.
Select observations
You can select observation features either interactively or using attributes the same way you do with standard feature layers, but you cannot create a selection layer from the resulting selection. Unlike standard feature layers, the selection is not persisted with the map or the layer when you save the map or project.
Work with the attribute table
The attribute table of a stream layer consists of the observations currently in memory, based on the broadcast observations of the stream service, a definition query (if one is present), and observation expiration settings. Stop the stream and open the attribute table to see them. You must stop the stream to see records in the attribute table. The attribute table shows a static snapshot of the observations as they were when the service was stopped. Discarding observations from the map or scene also clears these records from the attribute table.
Create a chart
You can explore patterns and trends in streaming data by creating a chart of the streaming data. Stop the stream and make a chart from the snapshot of the data.
Use stream layers in geoprocessing
You can use stream layer observations as inputs to geoprocessing tools, but because the data is dynamic, it's recommended that you stop the input stream as you open the geoprocessing tool and restart it after processing is complete.
Share stream layers
You can create a layer file (.lyrx) from a stream layer, but you cannot create a layer package (.lpkx) from it. You can share a map containing stream layers as a web map, but you cannot share the map or the stream layer as a map image layer or web feature layer.
You can place maps or scenes with stream layers on layouts, but you cannot properly print or export the stream layer with the layout.