In this topic, you will learn how to configure the Vision Zero solution to meet specific needs in your organization.
Modify hazard types and responsible agencies
Vision Zero includes problem types and responsible agencies for hazard reports. In some cases, you may want to add a problem type. In addition, you may want to modify the responsible agencies provided to more accurately reflect the name of the agency, department, or team that is responsible for responding to hazard reports.
- Sign in to your ArcGIS organization and browse to the TransportationHazardReports feature layer.
- Open the item page and click the Data tab.
- Click Fields.
- Click the Problem observed display name.
Review the List of Values (Domain). Identify domains that are missing or need to be removed from the list.
- Click Edit next to List of Values (Domain).
- Optionally, click Add.
- Type the problem type in the Displayed Value and Stored Value text boxes.
- Repeat steps 6 and 7 to add the remaining problem types.
- Optionally, click Delete to remove a problem type.
- Optionally, click in the Label text box with an existing problem type and change the name. Repeat this step to change the Code value as well.
- Optionally, drag the problem type to a new location in the list to reorder them.
- Click Save.
Now, let’s review the list of responsible agencies and modify it to meet the needs of your organization.
- Click the Assigned To display name in the left panel.
Review existing agencies and identify missing ones in the List of Values (Domain) section.
- Click Edit next to List of Values (Domain).
- Optionally, click Add.
- Type the new agency name in the Displayed Value and Stored Value text boxes.
- Repeat steps 3 and 4 to add the remaining missing agencies.
- Optionally, click Delete to remove an agency.
- Optionally, click in the Label text box with an existing agency labeled and change the agency name. Repeat this step to change the Code value as well.
- Optionally, drag the category to a new location in the list to reorder them.
- Click Save.
Update the pledge survey
The Vision Zero Pledge survey allows you to enlist the general public in practicing safe driving behaviors. Review the preconfigured questions and align the survey with your organizational policies and desired outcomes.
To modify the Vision Zero Pledge survey, complete the following steps:
- Verify that you are signed in to your ArcGIS organization and browse to the Vision Zero Pledge form.
- Open the item page and click Open in Survey123 > Manage in Survey123 website.
- Click the Design tab.
- Edit the survey and save the changes.
- Click Publish twice.
Configure the Vision Zero site
The Vision Zero solution includes the Vision Zero ArcGIS Hub site. This site can be configured with your organization's branding and used to share strategies to eliminate traffic deaths of and life-altering injuries to travelers in the community.
Update with organizational information
After deploying the Vision Zero solution, the Vision Zero Hub site layout requires a few updates to fit your local context.
To update the site with your organizational information, complete the following steps:
- Verify that you are signed in to your ArcGIS organization and browse to the Vision Zero site.
- From the item page, click Configure.
- Scroll to the By the Numbers statistics section under the Hub site title.
The Taken the Vision Zero Pledge summary statistic card is already linked to the Vision Zero solution’s VisionZeroPledge_opendata feature layer. This statistic automatically updates as pledges are submitted.
The Fatalities and Seriously Injured statistic are provided in text cards styled to resemble the summary statistic card, but you can manually enter a statistic of your choice, independent of the solution data.
- To update the Fatalities or Seriously Injured card, click the edit pencil , and update the numbers .
- Scroll to the Transportation Hazards section, hover over the Other Reporting Methods text card and click the edit pencil.
- Click Edit in HTML, update the phone number, and click Apply.
- Scroll to any additional sections that you want to update, hover over the card, and click the edit pencil that appears in the horizontal toolbar, and then edit the content with information specific to your organization.
- In the side panel, click Footer.
A custom footer is provided. In most cases, you will need to update it with your organization's branding, contact information, and social media references.
- Click the HTML text box.
The HTML window appears.
- Make the necessary changes and click Apply.
- Click Save.
- Click the Save drop-down arrow and click Publish Draft.
Share items with the public
Several layer views, maps, and apps included in the Vision Zero solution must be shared with everyone so they can be accessed by the public on the Vision Zero site. To share your items with everyone, use the guide below and complete the following steps:
- Verify that you are signed in to your ArcGIS organization.
- Next to each of the following items, check the check box:
Name Item type TransportationHazardReports_public
Feature layer (hosted, view)
Transportation Hazard Reporter
Web Map
Transportation Hazard Reporter
Web Mapping Application
TransportationHazardReports_dashboard
Feature layer (hosted, view)
Transportation Hazard Dashboard
Web Map
Transportation Hazard Desktop Dashboard
Dashboard
Transportation Hazard Mobile Dashboard
Dashboard
Transportation Hazard Dashboard
Web Experience
Vision Zero Pledge
Form
VisionZeroPledge_public
Feature layer (hosted)
VisionZeroPledge_opendata
Feature layer (hosted)
Vision Zero
Site Application
- Click Share.
- In the Share window, click Everyone (public) and click Save.
The Warning: Sharing editable layers publicly message appears notifying you that you are sharing editable layers publicly.
- Click Update.
- At the top of the site, click Groups.
- Open the Transportation Hazard Reporter group page and click the Settings tab.
- Under Who can view this group, click Everyone (public).
Extend Vision Zero
You can extend the Vision Zero solution with a set of Python tools that can be used to generate report IDs, moderate reports, send email notifications, and enrich reports. These tools can be executed automatically via Task Scheduler and as new problem reports are submitted, or updated, the corresponding action will occur.
Add the ServiceFunctions toolbox
The ServiceFunctions toolbox contains tools for generating report IDs, moderating reports, sending email notifications, and enriching reports. Download and add the ServiceFunctions toolbox to your ArcGIS Pro project before configuring the appropriate tools.
- Download the ServiceFunctions toolbox.
- Browse to the ServiceSupport.zip file and unzip the file to the location from which you want to the tools to execute.
- Open ArcGIS Pro and create a new project.
- Sign in to the ArcGIS organization to which you deployed the Vision Zero solution, if necessary.
- On the View tab, in the Windows group, click the Catalog pane, if necessary.
- In the Catalog pane, right-click Toolboxes and choose Add Toolbox.
The Add Toolbox dialog box appears.
- Browse to the ServiceSupport folder.
- Click the ServiceSupport.pyt Python toolbox, and click OK.
- In the Catalog pane, expand Toolboxes and ServiceSupport.pyt.
If you've never used the ServiceSupport toolbox before, run the Define Connection Settings tool to establish a connection between the toolbox and the TransportationHazardReports feature layer.
- In the Catalog pane, in the ServiceSupport.pyt Python toolbox, double-click the Define Connection Settings tool.
- In the ArcGIS Online organization or ArcGIS Enterprise portal URL parameter, click the drop-down arrow and choose a URL.
- In the Username parameter, type your user name for the organization you chose in step 11.
- In the Password parameter, type your password for the user name provided in the Username.
- Click Run.
Generate report IDs
Many workflows require you to generate a unique identifier when a feature or record is created so it can be referenced and tracked in other workflows. You can use the Generate IDs tool to configure custom unique identifiers that will be applied to features at a regularly scheduled interval of your choosing. The tool only generates the configuration; you must run an additional script (provided) to update the features with incrementing identifier values.
- In the Catalog pane, expand Toolboxes and ServiceSupport.pyt, if necessary.
- Double-click the Generate IDs tool.
- In the Layer parameter, click Browse.
The Layer dialog box appears.
- Under Portal, click My Content.
- Double-click the Vision Zero folder.
- Double-click the TransportationHazardReports feature layer.
- Click Transportation Hazard Reports, and then click OK.
Expand General Identifier Settings. If the tool has not been run previously, start by specifying at least one identifier sequence.
- In the Sequence Name parameter, type a name for the sequence.
This value appears in the drop-down menu for selecting the sequence to assign to each layer.
- In the Pattern parameter, type a pattern to use for the sequence.
This can be a combination of letters, numbers, and symbols. Mark the location for the incrementing value with a pair of curly braces {}. Python formatting is applied to the pattern text, so string formatting syntax such as {0:03d} pads the incrementing number section with zeros to a length of 3. For example, the expression seq-{0:05d} creates the following pattern of values: seq-00001, seq-00002, seq-00003, and so on.
- In the Next Value parameter, type a value.
When initially creating the sequence, this must be the first value in the identifiers. After this point, this value shows the value to be used for the next identifier generated.
- In the Interval parameter, type a value.
The interval by which the identifier values increase between features. For example, an initial Next Value of 1 and an Interval of 10 creates identifiers with the incrementing values of 1, 11, 21, and so on.
Deleting or changing these sequences impacts all the layers that are configured to use the edited sequences.
- Optionally, edit the identifier configuration and run the tool to overwrite the existing identifier configuration for the selected layer.
Note:
If an identifier configuration already exists, a check box appears that, when checked, deletes the existing identifier configuration for the selected layer.
- Choose the moderation list to use to process the features in the selected layer.
- Choose the sequence to use to generate the identifiers for each feature in the layer.
- Choose a text field to store the generated identifier.
- Click Run to write out the identifier configuration for the layer and any changes to the identifier sequences.
- To configure identifiers for another layer, rerun the tool with the settings for the next layer.
General Identifier Settings are not specific to any one layer—they apply to all layers configured using this tool.
Moderate reports
Public comment apps can occasionally generate feedback that should not be made publicly visible. Data entered into specific fields, such as personal information, can be hidden and protected using the pop-up configuration and layer security, but sometimes entire comments need to be hidden to avoid displaying sensitive or explicit content to other users.
You can hide features by updating the value of a field so that it no longer meets the requirements of a filter applied to that layer in the map. You can use the Moderate Reports tool to configure which layers and fields to scan for explicit or sensitive words and phrases and how to update the feature so that it can be filtered from the map. You can choose how often to scan features and records. The tool only generates the configuration; an additional script (provided) must be run to scan the features.
- In the Catalog pane, expand Toolboxes and ServiceSupport.pyt.
- Double-click the Moderate Reports tool.
- In the Layer parameter, click Browse.
The Layer dialog box appears.
- Under Portal, click My Content.
- Double-click the Vision Zero folder.
- Double-click the TransportationHazardReports feature layer.
- Click Transportation Hazard Reports, and then click OK.
Expand General Moderation Settings. If the tool has not been run previously, start by specifying at least one moderation list.
- In the List Name parameter, type a name.
This value appears in the drop-down menu for selecting the moderation list use when scanning each layer.
- In the Filter Type parameter, click the drop-down arrow and choose to scan feature for words and phrases that exactly match the provided list of words and phrases.
For example, when the filter type is EXACT, if the list contains the word duck, the script updates the specified field when the feature contains the word duck, but not when it contains the word duckling. When the filter type is FUZZY, the script updates the feature when either duck or duckling are found.
- In the Words and Phrases parameter, type a word or phrase. Provide a comma-separated list of words or phrases to scan for.
Keep in mind that deleting or changing these lists will impacts all the layers that are configured to use the edited sequences.
- If a moderation configuration already exists for the selected layer, choose to edit an existing configuration by selecting the name of the moderation list used in the configuration, or choose the option to add a new moderation configuration.
If you choose to edit an existing configuration, a check box appears that, when checked, deletes the existing moderation configuration for the selected layer. Alternatively, edit the moderation configuration and run the tool to overwrite the existing moderation configuration for the selected layer and moderation list.
To add a new moderation configuration, click the Add New button and continue with the following steps.
- Choose the moderation list to use to process the features in the selected layer.
- Choose the fields that will be scanned for content that matches the words and phrases in the selected moderation list.
- Optionally, provide an SQL query to only apply moderation to some features.
If no query is provided, all features are processed.
- Use the Field to Update parameter when a match is found between the value of a field and the content of a moderation list. Use the Found Value parameter to specify the value that should be written to this field indicating a match.
- Click Run.
Send email notifications
Many workflows require that an email be sent when a feature or record is created and updated. You can use the Send Emails tool to configure emails that can be sent based on attribute values and a schedule of your choosing. The tool only generates the configuration; you must run an additional script (provided) to actually generate and send the emails.
- In the Catalog pane, expand Toolboxes and ServiceSupport.pyt.
- Double-click the Send Emails tool.
- In the Layer parameter, click Browse.
The Layer dialog box appears.
- Under Portal, click My Content.
- Double-click the Vision Zero folder.
- Double-click the TransportationHazardReports feature layer.
- Click Transportation Hazard Reports, and then click OK.
All existing email settings for the layer load and can be edited by updating the parameter values for each configuration. To delete a single email configuration, click the Remove button next to the configuration. To delete all the email configurations for the layer, check the Delete all existing email configurations for this layer check box. Run the tool to save your changes.
- In the Email Template parameter, click Browse to access the ServiceSupport folder.
- Click one of the HTML templates for the body of the email, and click OK.
To add attributes from the triggering feature to the email, use unique string keys in the places where the values should appear in the HTML and reference these strings in the Find parameter of the Email Substitutions section of the General Email Settings along with the name of the field that contains the value to be substituted for the string key in the Replace parameter.
- Optionally, in the SQL Query parameter, provide an SQL query to only trigger an email from specific features.
If no query is provided, all features trigger emails every time the script is run, so you most likely want to use this query along with the Field to Update and Sent Value parameters to ensure that the same email isn't sent repeatedly for the same feature.
- In the Recipient Email Address parameter, type an email address of the recipient or the name of a field in the layer that contains the address of the recipient.
- In the Email Subject parameter, type the subject for the email.
Similar to the email body provided in the HTML document, this text can contain string keys that will be swapped out for attribute values based on the Find and Replace values defined in the Email Substitutions list in the General Email Settings section.
- In the Field to Update parameter, type Email. When the email has been sent for each feature, use the Sent Value parameter to specify the value that should be written to this field indicating that the email has been sent.
This field and value can be used in the previously described SQL query to prevent duplicate emails from being sent.
- Configure additional emails to be sent for the currently selected layer by clicking the Add New button.
Emails will be sent in the order they are configured. Expand General Email Settings. If the tool has not been run previously, start by specifying the connection information for your SMTP server in the tool.
- In the SMTP Server parameter, type the URL of the SMTP server used for sending emails.
- In the SMTP Username parameter, type the user name required to authenticate to the SMTP server. This is not required if authenticating through a port.
- In the SMTP Password parameter, type the password required to authenticate to the SMTP server. This is not required if authenticating through a port.
- In the From Address parameter, type the address from which the emails should be sent.
- In the Reply Address parameter, type the address that should be used for any replies to the email message.
- Check or uncheck the Use TLS check box to turn on or off TLS.
- In the Email Substitutions section, type Find and Replace values. Swap out one piece of text for another in the outgoing email subject or body.
Anywhere a value in the Find parameter is found in the email subject or body, it will be replaced with the corresponding value from the Replace parameter. If the value in the Replace parameter is a field in the layer, the Find value will be replaced with the value in that field in the triggering feature. For example, to add the ID of a feature from the REQUESTID field to the email subject, include a piece of text such as {ID} in the configured Email Subject, and add {ID} to the Find parameter and REQUESTID to the Replace parameter. All specified substitutions are applied to all emails configured for all layers so, while the Find values can be any piece of text, it's suggested that you use something that is clearly variable-like and unlikely to appear elsewhere in the messages in a literal form.
Deleting or changing these settings impacts all the emails for all the layers configured with this tool.
- Click Run.
Enrich reports
Reports made in public comment apps can be enriched with information about the report location. You can then use this information to efficiently direct the report to the correct person or agency responsible for its resolution.
You can then use the Enrich Reports tool to configure which attribute values to calculate from a coincident or intersecting set of features at a regularly scheduled interval of your choosing. Note that the tool only generates the configuration; you must run an additional script (provided) to update the features based on intersecting features.
- In the Catalog pane, expand Toolboxes and ServiceSupport.pyt.
- Double-click the Enrich Reports tool.
- In the Layer parameter, click the browse button.
The Layer dialog box appears.
- Under Portal, click My Content.
- Double-click the Vision Zero folder.
- Double-click the TransportationHazardReports feature layer.
- Click Transportation Hazard Reports, and then click OK.
- In the Enrichment parameter, if an enrichment configuration already exists for the selected layer, choose to either edit an existing configuration by selecting the configuration from the drop-down list, or choose the option to add a new enrichment configuration.
If you choose to edit an existing configuration, a check box appears that, when checked, deletes the existing enrichment configuration for the selected layer. Alternatively, edit the configuration and run the tool to save the changes. To add a new enrichment configuration, click the Add New button and continue with the following steps.
- Choose the polygon feature layer that will provide the enriching attribute values by either choosing a layer from the active map or by browsing to your hosted content and choosing a polygon feature layer.
- In the Source Field parameter, click the drop-down arrow and choose a field from the enrichment layer.
- In the Target Field parameter, click the drop-down arrow and choose a field from the TransportationHazardReports feature layer.
The script does not process features that already have a value in the target field.
- In the Priority parameter, type a value. Specify the priority that should be given to this enrichment configuration relative to the other configurations for the TransportationHazardReports feature layer.
Enrichment configurations for a layer that have a lower priority value will override enrichment configurations with a higher value. For example, a layer has two enrichment configurations that use the same target field, but one has a priority value of 1 and the other has a priority of 2. If the configuration with priority 1 does not produce a valid value for the field, the field is populated with the value produced from the configuration with priority 2.
- Click Run.
Set up Task Scheduler
Use Windows Task Scheduler to schedule the script to generate report IDs when a feature or record is created, moderate reports when feedback contains inappropriate language, send email notifications when a feature or record is created or updated, or enrich reports. All the tools in this toolbox share a common configuration file and execution script, so only one scheduled task is required to automate running all the associated processes.
- Open the Task Scheduler on the computer that is hosting the scripts.
- Click Action > Create Task and name your task.
- Click the Action tab and click New.
- Set Action to Start a Program.
- Browse to the location of your Python 3 installation (for example, <default directory>\C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe).
- In the Add arguments text box, type the name of the script (servicefunctions.py).
- In the Start in text box, type the path to the folder where your script is and click OK.
- Click the Trigger tab, click New, and set a schedule for your task.
- Click OK.
When the trigger occurs, the scripts begin scanning the configured layers and, for each one, processing (in order) configurations for generating identifiers, enriching reports, moderating reports, and sending emails.