Visualize Features

Visualization is the visual presentation of data to help users explore and understand the data.

Two common visualization tasks in GIS are:

This topic discusses Geocortex Workflow methods to present feature data and show the features on the map.

This discussion is limited to methods for showing features from within a workflow. Your host application may support additional visualization techniques. Refer to the application's documentation for information.

Geocortex Workflow provides the following ways to show features:

Use the Show Results Activity for Visualization

The Show Results activity displays the features in a feature set. If the features have geometries, they are highlighted on the map. You can also use the Show Results activity to combine feature sets as long as the features are from the same layer. The Show Results activity supports union (default), intersect, replace, and subtract operations.

The Show Results activity uses whatever mechanism the host application provides to display features. This means that the presentation varies between applications. For example, Web AppBuilder presents features in attributes tables. The Geocortex Viewer for HTML5 can show features in a list (default) or in a table.

Because the Show Results activity relies on the host application to display the features, you must test any workflow that contains a Show Results activity in the host application, instead of in the Sandbox. The Sandbox does not have access to the host application's feature-display mechanism.

The way you configure the Show Results activity may also differ between applications. For example, a Geocortex HTML5 viewer has access to information about the map's layers through the site. Web AppBuilder does not have access to this information. In addition, some of the activity's inputs are supported only by the Geocortex Viewer for HTML5. For these reasons, the host applications are discussed separately:

Use the Show Results Activity in the Geocortex Viewer for HTML5

The Show Results activity takes any feature, collection of features, or feature set that exists in the workflow, converts it to a feature set if necessary, adds the feature set to a collection, and displays the features. If the collection already exists, you can combine the feature set with an existing feature set, provided the features are from the same layer.

The Geocortex Viewer for HTML5 displays results in a list in the side panel by default (). The geometries are highlighted on the map (). In the screen capture, the state of Montana is highlighted a different color because the user is hovering the pointer over Montana in the Results list ().

Features displayed using the Show Results activity, shown in the Geocortex Viewer for HTML5

The Geocortex Viewer for HTML5 offers many additional functions for working with results:

 

View Feature Details - Clicking a particular feature in the Results list zooms the map to that feature and displays details about the feature, including the feature's attributes. To return to the Results list, the user clicks the close icon .

Panel Actions Menu - The Panel Actions menu offers functions that operate on the features in the Results list, such as exporting or saving the features. The Panel Actions menu also has an option to switch between list view and table view.

Feature Actions Menu - The Feature Actions menu offers functions that operate on a particular feature in the Results list, such as buffering the feature or removing the feature from the list.

Collection Panel - The Geocortex Viewer for HTML5 supports multiple feature sets in a collection. Clicking the icon to go to the previous panel shows the feature sets in the collection. The Results Actions menu () has functions that operate on the feature sets, such as combining feature sets.

The Show Results activity fulfills the same purpose in Geocortex Workflow as the Select Features activity fulfills in Geocortex Essentials Workflow.

Configure the Show Results Activity to Run in the Geocortex Viewer for HTML5

To configure a Show Results activity, you must configure the Features input, which specifies the features to show. You will configure additional inputs. The particular inputs you configure depend on your scenario. The main factors that determine which inputs to configure are:

Inputs Supported by the Geocortex Viewer for HTML5

The Geocortex Viewer for HTML5 supports all of the Show Results activity's inputs:

Example 1 - Use the Show Results Activity's Inputs to Format Features

This example shows you how to use a Show Results activity to display the features returned by a Query Layer activity when the Show Results activity does not have access to the layer's configuration. Because the Show Results activity does not have access to the layer, the geometries are displayed on a graphics layer created for that purpose.

This example assumes that you already have a Geocortex HTML5 viewer that you can use to run the workflow. To demonstrate conclusively that the Show Results activity uses the formatting configured in the activity, rather than the formatting in the layer’s configuration, the layer should not exist in the site.

Workflow Logic

The workflow has the following activities, in the order shown:

To format and show query results that are displayed by a Show Results activity:

  1. Open Workflow Designer.

  2. In a new, blank workflow, add the following activities and connect them in the given order:

  3. Query Layer (query1): Configure the inputs:

  4. Show Results: Configure the inputs:

  5. Press Ctrl+S to save the workflow.

  6. Configure your viewer to run the workflow.

    See Host and Run Workflows in the Geocortex Viewer for HTML5 for information.

  7. Launch or refresh the viewer and run the workflow.

    The features listed in the Results list are formatted using the formatting configured in the Show Results activity.

Example 2 - Use the Layer's Existing Configuration to Format Features

In this example, the features come from a Query Layer activity that is configured the same as the Query Layer activity in Example 1. In this example, however, the layer that the features belong to exists in the map. The Show Results activity is configured to take advantage of the layer's configuration:

Workflow Logic

The workflow has the following activities, in the order shown:

If you want to try this example, configure the following site and viewer:

  1. Create an empty site.

  2. Add the Open Street Map basemap: Click Add Map Service, search for Open Street Map, and click Add to Map.

    The map service's ID should be 0. The ID is given on the map service's Details tab.

  3. Set the layer's Feature Label to: State Name: <i>{STATE_NAME}</i>

  4. Set the layer's Feature Long Description to:

    Population: <i>{POP2007}</i><br />
    Area: <i>{SQMI} sq.mi.</i>

  5. Add the following layer to the map: https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3

    This is the URL for a layer of US states. The layer's ID is 3.

  6. Add an HTML5 viewer.

To use the viewer's configuration to format query results that are displayed by a Show Results activity:

  1. Open Workflow Designer.

  2. In a new, blank workflow, add the following activities and connect them in the given order:

  3. Query Layer (query1): Configure the inputs:

  4. Show Results: Configure the inputs:

  5. Press Ctrl+S to save the workflow.

  6. Configure the viewer to run the workflow.

    See Host and Run Workflows in the Geocortex Viewer for HTML5 for information.

  7. Launch or refresh the viewer and run the workflow.

    The features in the Results list are formatted using the formatting configured in the layer's configuration.

Example 3 - Use the Show Results Activity to Combine Feature Sets

This example shows you how to use a Show Results activity to combine the feature set with an existing feature set from an earlier Show Results activity. The features belong to a layer of US states returned by two Query Layer activities. The first query returns the 3 states in the Middle Atlantic region. The second query returns the 4 states in the East South Central region. The second Show Results activity combines the two sets of states using a union operation, resulting in a feature set of 7 states, which are displayed using the layer's configuration.

Workflow Logic

The workflow has the following activities, in the order shown:

If you want to try this example, follow the instructions in Example 2 to configure the site and viewer.

To combine feature sets using two Show Results activities:

  1. Open Workflow Designer.

  2. In a new, blank workflow, add the following activities and connect them in the given order:

  3. Query Layer (query1): Configure the inputs:

  4. Show Results: Configure the inputs:

  5. Delay: Set the Duration input to: 5000

  6. Query Layer (query2): Configure the inputs:

  7. Show Results: Configure the inputs:

  8. Press Ctrl+S to save the workflow.

  9. Configure your viewer to run the workflow.

    See Host and Run Workflows in the Geocortex Viewer for HTML5 for information.

  10. Launch or refresh the viewer and run the workflow.

    The features from both queries are displayed.

  11. Click the Go Back In Panel icon to go to the previous panel.

    The US States collection contains a single feature set with 7 features.

Use the Show Results Activity in Web AppBuilder

The Show Results activity works in 2D Web AppBuilder apps only. The Show Results activity does not work in 3D apps.

In Web AppBuilder, feature data is displayed in attributes tables. Each layer has its own table on a separate tab.

The Show Results activity uses the layer's attributes table to display the feature data. If the features have geometries, the geometries are highlighted on the map.

If there are already features selected in the layer when the Show Results activity runs, the feature set is combined with the features that are already selected. For example, you could add two Show Results activities to your workflow. The first Show Results activity displays and selects its feature set. The second Show Results activity combines its feature set with the existing features and selects the features in the combined set.

Configure the Show Results Activity to Run in Web AppBuilder

To configure a Show Results activity in a workflow that will run in Web AppBuilder, you must configure the Features and Layer Name inputs. Configuring the Combine Mode input is optional. Note that these are the only inputs that Web AppBuilder supports.

Inputs Supported by Web AppBuilder

Example - Use the Show Results Activity in Web AppBuilder

This example shows you how to use a Show Results activity to display the features returned by a Query Layer activity in a Web AppBuilder app. The query returns features for US states in the Mountain region. The geometries are also returned.

This example assumes that you already have a 2D Web AppBuilder app that you can use to run the workflow. The map should include this layer https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3.

Workflow Logic

The workflow has the following activities, in the order shown:

To use the Show Results activity to show query results in a Web AppBuilder app:

  1. Open Workflow Designer.

  2. In a new, blank workflow, add the following activities and connect them in the given order:

  3. Query Layer: Configure the inputs:

  4. Show Results: Configure the inputs:

  5. Press Ctrl+S to save the workflow.

  6. Configure your Web AppBuilder app to run the workflow.

    See Host Workflows in Web AppBuilder for ArcGIS for information.

  7. Launch or refresh the app and run the workflow.

    The features are listed in the attributes table and highlighted on the map.

Use the Add Graphics Layer Features Activity for Visualization

The Add Graphics Layer Features activity allows you to add features to a graphics layer. If the features have symbols, they are displayed on the map.

You must specify the graphics layer to use. If you specify a layer that already exists, by default the activity aggregates the new features with any existing features in the layer. You can use this fact to accumulate features in a graphics layer. If you do not want to carry forward existing features, set the Remove All Features input to true. This clears the layer before adding the new features.

If you specify a layer that does not exist, the activity creates the layer.

Example 1 - Use the Add Graphics Layer Features Activity to Display a Dynamically Created Feature

This example shows you how to use an Add Graphics Layer Features activity to display a feature that is created at run-time. The workflow uses a Get Symbol From JSON activity to define the feature's symbol and a Geometry Picker form element to get the geometry from the user. The feature is created using a Create Feature activity. The layer specified in the Add Graphics Layer Features activity does not exist, so the activity creates a new layer to add the features to.

Workflow Logic

The workflow has the following activities, in the order shown:

To use the Add Graphics Layer Features activity to show a dynamically created feature on the map:

  1. Open Workflow Designer.

  2. In a new, blank workflow, add the following activities and connect them in the given order:

  3. Get Symbol From JSON (symbol1): Set the Json input to:

    {
       "type": "esriSFS",
       "style": "esriSFSSolid",
       "color": [0,255,0,100],
       "outline": 
       {
          "style" : "esriSLSSolid",
          "color": [0,255,255,200],
          "width": 2
       }
    }

    This symbol has an aqua outline and green fill.

  4. Display Form (form1):

    1. Double-click the Display Form activity to edit it.

    2. Add a Geometry Picker form element. Use the Geometry Picker's default configuration.

    3. Click Start in the breadcrumbs to return to the main workflow.

  5. Create Feature: Configure the inputs as follows:

  6. Add Graphics Layer Features: Configure the inputs as follows:

  7. Press Ctrl+S to save the workflow.

  8. Run the workflow in the Sandbox using the 2D Map (ArcGIS API v3.x) environment.

    To run a workflow in the Sandbox, click Info in the sidebar, click Run in Sandbox, select the environment, configure the Sandbox settings, and then click Run Workflow. You can press F12 at any time to see the verbose log.

    The workflow displays the geometry entered by the user using a fill symbol.

Example 2 - Use the Add Graphics Layer Features Activity to Display Query Results

This example shows you how to use an Add Graphics Layer Features activity to display the features returned by a Query Layer activity. The query returns four US states. The workflow zooms the map to the returned states, assigns a fill symbol to each feature, and then uses the Add Graphics Layer Features activity to show the features on the map. This example specifies a graphics layer that does not exist, so the activity creates a new layer to add the features to.

Workflow Logic

The workflow has the following activities, in the order shown:

To use the Add Graphics Layer Features activity to show query results on the map:

  1. Open Workflow Designer.

  2. In a new, blank workflow, add the following activities and connect them in the given order:

  3. Query Layer (query1): Configure the inputs:

  4. Set Map Extent: Set the Features input to: =$query1.features

  5. Get Symbol From JSON (symbol1): Set the Json input to:

    {
       "type": "esriSFS",
       "style": "esriSFSSolid",
       "color": [255,255,0,255],
       "outline": 
       {
          "style" : "esriSLSSolid",
          "color": [255,165,0,255],
          "width": 2
       }
    }

    This symbol has an orange outline and yellow fill.

  6. For Each:

    1. Set the Items input to: =$query1.features

    2. Double-click the For Each activity to open its subworkflow.

    3. Add a Set Feature Symbol activity, connect it to the For Each block, and configure the inputs as follows:

      • Feature: =$forEach1.item

      • Symbol: =$symbol1.symbol

    4. Click Start in the breadcrumbs to return to the main workflow.

  7. Add Graphics Layer Features: Configure the inputs as follows:

  8. Press Ctrl+S to save the workflow.

  9. Run the workflow in the Sandbox. Do not use the No Map environment.

    To run a workflow in the Sandbox, click Info in the sidebar, click Run in Sandbox, select the environment, configure the Sandbox settings, and then click Run Workflow. You can press F12 at any time to see the verbose log.

    The map zooms to the states returned by the query and displays the symbols.

Use the Item Picker Form Element for Visualization

You can use the Item Picker form element to display a filterable list of features and optionally allow the user to select one or more features. If you configure an item picker to allow selection, you can access the selection later in the workflow to perform additional processing. Alternatively, you can use an item picker strictly for display purposes. In either case, you can configure the item picker to display multiple lines of Markdown-formatted information about each feature, including feature attributes.

If the features listed by an item picker have geometries, they are highlighted on the map. The highlighting changes when the user clicks or hovers over a feature in the form.

Example - Use the Item Picker Form Element for Display and Selection of Features

This example uses two item pickers, one which allows selection and one that is used for display only. The first item picker queries an ArcGIS layer for US states in a particular region and allows the user to select one of the states. The second item picker queries a different ArcGIS layer to get county information for the selected state, and then displays several Markdown-formatted attributes for each county.

Workflow Logic

The workflow has the following activities, in the order shown:

To use the Item Picker form element to show query results and allow the user to select a result:

  1. Open Workflow Designer.

  2. In a new, blank workflow, add and connect the following activity:

  3. Double-click the Display Form activity to edit it.

  4. Create the following form:

    To configure the form:

    1. Select the Form Title element in the form preview and set its Title property to: Counties in the Mid Atlantic States
    2. Item Picker (itemPicker1): Add an Item Picker form element and configure it as follows:

      1. Configure the element's properties:

        • Set the Title property to: Pick a state:

        • Set the Filter Hint Text property to: US States in the Mid Atlantic Region

        • Make sure Selection Mode is set to: Single

          This puts a radio button beside each state so the user can select a state.

      2. In the Items area, click ArcGIS Query.

        The ArcGIS Query subworkflow opens.

      3. Query Layer (query1): Configure the Query Layer activity's inputs:

        • Set the Where input to: SUB_REGION='Middle Atlantic'

        • Set the Return Geometry input to: true

        • Set the Output Spatial Reference input to: 102100

        • Set the Output Fields input to: STATE_NAME

      4. Set the Get Form Element Items From Features activity's Label input to: STATE_NAME

      5. Set Map Extent: Add a Set Map Extent activity to the bottom of the subworkflow and connect the Set Form Element Items activity to it. Configure its inputs:

        • Set the Scale input to 10 million: 10000000

        • Set the Features input to: =$query1.features

      6. Click Display Form in the breadcrumbs to return to the form preview.

    3. Item Picker (itemPicker2): Add another Item Picker form element and configure it as follows:

      1. Configure the element's properties:

        • Set the Depends On property to: itemPicker1

          This populates the item picker when the user selects a state in the previous item picker.

        • Set the Selection Mode property to: None

          The user will not be able to select features displayed by the item picker.

      2. In the Items area, click ArcGIS Query.

        The ArcGIS Query subworkflow opens.

      3. Query Layer (query2): Configure the Query Layer activity's inputs:

        • Set the Url input to: https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/2

        • Set the Where input to: =`STATE_NAME='${$form1.state.itemPicker1.value.items[0].value.data.attributes.STATE_NAME}'`

          This input uses a template literal. For information on template literals, see String Expressions.

          The data property provides access to the item's underlying feature.

        • Set the Return Geometry input to: true

        • Set the Output Spatial Reference input to: 102100

        • Set the Output Fields input to: NAME, SQMI, POP2007

      4. Set the Get Form Element Items From Features activity's Label input to:

        ### {NAME}
        Area: *{SQMI} sq mi*\
        Population: *{POP2007}*

      5. Set Map Extent: Add a Set Map Extent activity to the bottom of the subworkflow and connect the Set Form Element Items activity to it. Configure its inputs:

        • Set the Scale input to 5 million: 5000000

        • Set the Features input to: =$query2.features

      6. Click Display Form in the breadcrumbs to return to the form preview.

    4. Add a Horizontal Rule form element between the second item picker and the footer.

  5. Press Ctrl+S to save the workflow.

  6. Run the workflow in the Sandbox. Do not use the No Map environment.

    To run a workflow in the Sandbox, click Info in the sidebar, click Run in Sandbox, select the environment, configure the Sandbox settings, and then click Run Workflow. You can press F12 at any time to see the verbose log.

    The form loads and displays the first item picker, which displays a list of states in the Middle Atlantic region, with a radio button beside each state. The map zooms to the Middle Atlantic states and highlights them on the map.

  7. Select New York in the form.

    The second item picker loads and displays a formatted list of the counties in New York. The map zooms to New York and changes the highlighting to indicate that New York is selected in the form. New York's counties are also highlighted on the map. If you hover the pointer over a county in the form, the county's highlighting changes on the map.

  8. Select Pennsylvania in the form.

    New York's counties will be replaced with Pennsylvania's counties in the form and on the map.

© 2019 Latitude Geographics Group Ltd. All Rights Reserved.

Documentation Version 5.11