Create a policy map
A policy map \shows areas where policy intervention should occur. You'll create a policy map of Pasadena, California, that shows the five school zones with the most traffic accidents in which a pedestrian or cyclist was injured or killed. The city can then focus policy efforts on increasing safety in these areas.
Add data to your map
Your map's subject is pedestrian and bicycle accidents in Pasadena, so you'll start by adding relevant data to a new map.
- Sign in to your ArcGIS organizational account or into ArcGIS Enterprise using a named user account.
If you don't have an organizational account, see options for software access.
- On the ribbon, click the Map tab.
Depending on your organizational and user settings, you may have opened Map Viewer Classic. ArcGIS Online offers two map viewers for viewing, using, and creating maps. For more information on the map viewers available and which to use, please see this FAQ.
This tutorial uses Map Viewer.
- In the Layers pane, click Add.
The Add layer pane opens. By default, the search is set to only look for data in your account. You'll add data hosted in the Learn ArcGIS administrator account, prepared specifically for this tutorial. The data was originally compiled and uploaded by the City of Pasadena.
- Click My Content and choose ArcGIS Online.
- In the search box, type Traffic Collisions. To limit the search, add owner:Learn_ArcGIS. Press Enter.
- In the list of results, for Traffic Collisions, click the Add button.
The layer is added to the map. The map zooms to the extent of the layer, which is Pasadena, California.
Depending on the size of your browser window, the default zoom extent may differ from the example images. If necessary, zoom the map in or out until you see all the data clearly.
The layer shows all accidents that occurred in Pasadena during the past decade. With policy maps, it's essential to determine whether the dataset is a reasonable representation of reality. Any biases in the data can distort your results and lead to poorly informed policy.
In the example of traffic collisions, unreported accidents could be a potential bias. Because this data comes from the City of Pasadena municipal government, you know your data is an authoritative and accurate representation of traffic accidents.
Filter the data
Next, you'll filter the layer to show only accidents that involved a pedestrian or cyclist.
- In the Add layer pane, click the Back button.
The Layers pane includes the Traffic Collisions layer and your organization's default basemap. To filter a layer, you should first become familiar with its attribute information. You'll find out whether this layer has attributes that explain whether an accident involved pedestrians or cyclists.
- Point to the Traffic Collisions layer and click the Options button. Choose Show table.
The table opens. It contains the layer's attributes: additional information about the data on the map. Each row corresponds to a single accident, while each column is a field that includes a specific type of information.
- Scroll through the table until you find the InvolvedWith field.
This field describes who was involved in the crash. It includes information about whether the crash involved a pedestrian, a cyclist, or another motor vehicle. You can use this field to filter your layer.
- Close the table.
- In the Layers pane, make sure the Traffic Collisions layer is selected. On the Settings (dark) toolbar, click the Filter button.
The Filter pane opens. To filter the layer, you'll create a logical expression that shows which type of features to display, based on attribute information.
- In the Filter pane, click Add expression.
- Create the following expression:
- Click the first drop-down box and choose InvolvedWith. Click Replace.
- Leave the second drop-down box unchanged.
- Click the third drop-down box and choose Bicycle.
The expression reads InvolvedWith is Bicycle. It will filter the layer to show only crashes that involved a bicycle. You also want to include crashes that involved a pedestrian, so you'll create a second expression.
- Click Add expression. Create the expression InvolvedWith is Pedestrian.
By default, only features that match both expressions are shown. You'll change the parameters so features that match either expression are shown.
- Above the expressions, for Filter results, click Match all expressions and choose Match at least one expression.
- Click Save.
The data on the map is filtered. Only accidents involving either a cyclist or a pedestrian are shown.
Filtering your data highlights the subject of interest. If you wanted, you could also create filters to show only data from a specific year or time period. A date filter could be used to compare accidents over time and show whether city policies are having a positive effect.
You've mapped accidents, but what patterns can be found in the data? Are there areas where particularly large clusters of accidents are occurring? It's helpful to display the data in different map styles to find trends.
Ways to find patterns in your data include point clustering, heat maps, and hot spot analysis. These methods all reveal where accidents are happening at abnormal rates. You'll map the accidents using all three methods to gain insight into your data.
First, you'll apply clustering to your points. Clustering groups points within a certain distance of one another into a single symbol, showing where many points are located close together.
- On the Settings toolbar, click Aggregation and choose Clustering.
The symbols on the map are combined into clustered points. The larger the point, the more collisions the cluster represents. These cluster points were aggregated using default parameters; you can change the aggregation settings, labeling, and other properties of the cluster.
The areas with the highest clusters of accidents seem to be in the central part of the city. Labels on the points show how many features each cluster point represents.
- For Clustering, click Options. For Cluster Radius, drag the slider to show clusters of more or fewer accidents.
At less clustering, large clusters may represent as few as 20 accidents, while at more clustering, they may represent as many as 400. While clustering does tend to show patterns of where points are located in higher densities, the degree of clustering can change where those patterns seem to appear.
For instance, at some levels of clustering, the eastern side of Pasadena seems to have a high cluster of accidents, while at other levels, it does not.
- In the Clustering pane, click Back. Turn off Enable aggregation.
Next, you'll create a heat map of accidents. A heat map also shows where points are more densely located, but using color instead of symbol size.
- On the Settings toolbar, click Styles.
In the Styles pane, you can choose different styles for your data. The collision data is currently showing just the location of traffic accidents, so you have two options: Location (Single symbol) or Heat Map.
- Click Heat Map and choose Style options.
The drawing style is automatically applied to the map.
Like the clustered points, the heat map indicates a high density of accidents in central Pasadena. However, the heat map particularly emphasizes the area south of the Foothill Freeway, corresponding to downtown.
Although it may seem like the bright yellow areas are areas to focus policy, a heat map is not a policy map. A policy map takes a stand and explicitly indicates areas where policy should be focused. You still don't have enough information to make a claim like that. It's possible another way of exploring patterns will provide new information about the data.
- In the Styles pane, click Cancel.
The last way you'll explore patterns is through hot spots. Hot spots are statistically significant clusters in spatial data. While a heat map only shows accident density, a hot spot map uses statistical analysis to compare where concentrations are high and low relative to other areas. To create hot spots, you must run an analysis tool on your data.
- On the Settings toolbar, click Analysis.
The Tools pane opens.
- Expand Analyze Patterns and click Find Hot Spots.
The tool requires a few parameters. You'll set the layer you want to calculate hot spots for and change the default parameters so that the hot spots are shown in the form of hexagonal bins. Any parameters marked with a red dot are required to run the tool.
- For Input layer, click Layer and choose the Traffic Collisions layer.
- For Hot spot settings, leave the Variable type set to Point counts. For Aggregation shape type, choose Hexagon Cells.
- Change Result layer name to Traffic Collision Hot Spots and add your name of initials.
You cannot create two layers in an ArcGIS organization with the same name. Adding your initials to a layer name ensures that other people in your organization can also complete this tutorial. Once a layer has been created, you can rename it in the map to remove your initials, which will not affect the name of the underlying data layer.
- Click Estimate Credits.
Some analysis tools require service credits to run. To find out how many your analysis will cost, you can estimate the amount of credits needed. In many cases, such as with the Find Hot Spots tool, the number of features in your input layer will be multiplied by the cost of running the tool.
- Click Run.
The tool takes about a minute to run. When it finishes, the hot spots layer is added to the map.
- In the Layers pane, point to Traffic Collisions and click Hide layer.
The red hexbins show areas of spatially significant clustering, while white hexbins show areas with no significant clustering. There are no blue areas on the map, but if there were, they would represent areas with statistically low clustering. The map indicates that accidents happen statistically regularly across the city, but with a statistically significant clustering in the downtown area.
These results all point to patterns of high accidents in downtown. You now have a better understanding of the data.
- Point to the Traffic Collision Hot Spots layer and click Hide layer. Turn the Traffic Collisions layer back on.
Symbolize by category
Next, you'll change the symbols of your accidents layer to show different categories of accidents. In particular, you want to distinguish fatal accidents from accidents with only injuries. You also want to distinguish pedestrian accidents from bicycle accidents. This information adds more detail to your findings and helps support policymaker decisions on your subject.
To create these four symbol categories, you'll use an Arcade expression. Arcade expressions use attribute information to determine symbology.
- In the Layers pane, make sure Traffic Collisions is selected.
- On the Settings toolbar, click Styles.
- In the Styles pane, for Choose attributes, click Expression.
An Arcade expression editor window opens. The default name for the new expression is New expression.
- Delete the default name and type Collision Type.
For the first part of your expression, you'll create variables that represent the four categories you want to symbolize. Each variable will refer to an attribute field that contains information about the category. The first variable will be for accidents that involved pedestrians and cyclists.
- In the expression editor, delete the first three lines of sample code. On line 1, type var type = .
In Arcade, var means variable. The word type is the name of the variable, which you choose. Next, you'll choose the attribute field that defines this variable. As you learned when you looked at the data's table, the InvolvedWith field includes information on whether pedestrians or cyclists were involved in the accident. There are two ways to add variables to an expression. First, you'll use the Profile variables tab. The Profile variable method is good to use when you're not sure of the Arcade syntax, or want to see the entire list of variables available.
- Click the Profile variables tab. In the Profiles variables pane, click the arrow next to $feature.
- Scroll through the list of fields and click $feature.InvWith.
The field is added to the expression.
This variable can be used for both pedestrians and cyclists, so you only need to create two more variables, one for fatalities and one for injuries. The NumberKilled and NumberInjured fields contain information relevant to these variables. Now that you know the syntax for adding a variable, you'll add them directly through the expression editor.
- Press Enter. On line 2, type var fatal = $. In the autocomplete suggestions, choose feature.
- After $feature, type a period (.) In the autocomplete suggestions, choose NoKilled.
- Create another variables named injured and set the field as NumberInjured.
If you have difficulty creating the expressions, you can copy and paste the following text:
var fatal = $feature.NoKilled var injured = $feature.NoInjured
These three variables represent the four types of attributes you want to depict on the map. However, these variables aren't exclusive. Accidents involving pedestrians or cyclists likely also have injuries or fatalities. There are four combinations of the type, fatal, and injured variables:
- Accidents involving a pedestrian and a fatality
- Accidents involving a pedestrian and an injury
- Accidents involving a cyclist and a fatality
- Accidents involving a cyclist and an injury
To account for these combinations, you'll create a function.
- Press Enter twice. Type When (.
A When function indicates that when certain conditions are met, a specific symbology category will be used. First, you'll create a symbology category for pedestrian fatalities.
- Type type == "Pedestrian" && fatal == "1", "Pedestrian Fatality".
The syntax of this function may seem confusing, but all it says is that when the type variable equals Pedestrian and the fatal variable equals 1 (meaning one fatality), a category named Pedestrian Fatality is used.
You'll add more lines to the When function for the other categories.
- Type a comma and press Enter. Add the following lines to the expression inside the parentheses:
type == "Pedestrian" && injured != "0", "Pedestrian Injury", type == "Bicycle" && injured != "0", "Bicycle Injury", type == "Bicycle" && fatal == "1", "Bicycle Fatality", null
The part of the expression that reads injured != "0" indicates that any number of injuries that isn't 0 will fulfill the condition. This syntax is necessary because some accidents have two or more injuries. However, no accident in your data involving a cyclist or pedestrian has more than one fatality, so fatal == "1" will include all accidents that had a fatality. Details like these are why it's important that you understand your data before creating a policy map.
- Click Done.
The expression is used to symbolize the accidents. Each category has a different symbol.
In addition to the four categories you specified, there is a fifth category named Other (gray symbols). This category includes any accidents that didn't fulfill the conditions for any of the categories you created. These accidents are likely those that had neither injuries nor fatalities.
Next, you'll make the symbols more visually distinct. You'll change fatal accidents to have a larger symbol, while you'll distinguish between pedestrian and cyclist accidents with color. You'll also remove the Other symbols, as these accidents are probably minor and shouldn't affect policy.
- In the Styles pane, for Types (unique symbols), click Style options.
The pane changes to show a list of the categories and their symbols.
- Uncheck Other.
- Drag the three dots to the left of each symbol to rearrange them in the following order:
- Pedestrian Fatality
- Pedestrian Injury
- Bicycle Fatality
- Bicycle Injury
- Click the Pedestrian Fatality symbol.
The Symbol style window opens with symbol options. You'll make the symbol red and increase its size.
- Click Fill color. In the Select color window, change the hexadecimal value to #FF4040 and click Done.
- Under Basic point, uncheck Adjust size automatically. Change Size to 15 px.
- Close the Symbol style window.
- Change the remaining symbols with the following parameters:
- Pedestrian Injury: #FF4040 and 3 px
- Bicycle Fatality: #FFAA00 and 15 px
- Bicycle Injury: #FFAA00 and 3 px
The fatalities receive a larger symbol size to indicate the difference in severity between injuries and fatalities.
- In the Style options pane, click Done twice.
Lastly, you'll change the basemap so the symbols stand out more.
- On the Contents toolbar, click the Basemap button and choose Dark Gray Canvas.
The basemap changes automatically.
Now, the accidents stand out because the points are not competing with the basemap colors. There is also a clear distinction between bicycle and pedestrian accidents.
Add school areas
When it comes to policy decisions, hot spots and heat maps don't provide much context and make no explicit claims about the data. Because your subject is not only accidents but accidents near schools, you'll add a layer of Pasadena Unified School District (PUSD) schools to your map. Then, you'll find areas within a half-mile walking distance of each school.
- On the Contents toolbar, click Add and choose Browse Layers. Click My Content and choose ArcGIS Online.
- In the search box, type PUSD Schools owner:Learn_ArcGIS and press Enter. In the list of results, for the PUSD Schools layer, click the Add button.
The layer of schools is added to the map. By default, the schools have red point symbols that can be difficult to distinguish from the accident points. You'll change the symbol so the schools stand out more.
- On the Contents toolbar, click Layers. In the Layers pane, make sure PUSD Schools is selected.
- On the Settings toolbar, click the Styles button. For Location (Single symbol), click Style options.
- Click Symbol style.
The window for symbol style opens.
- In the Symbol style window, for Current symbol, click Basic point. Click the square symbol and click Done.
The square shape will be distinguishable from the circle shapes of the accidents. You'll also change the color to white so the symbols stand out against the dark basemap.
- Click Fill color. In the Select color window, change the hexadecimal value to #FFFFFF and click Done.
- For Outline color, choose the same white color and close the Symbol style window.
The symbol is applied to the map.
The schools now stand out and can be distinguished from the accidents. Next, you'll create the walk-time areas around each school. You'll later be able to calculate the number of collisions near each school.
- In the Style options pane, click Done twice.
- On the Settings toolbar, click the Analysis button and click Tools. Expand the Use Proximity group and click the Generate Travel Areas tool.
This tool uses road network data to create areas that can be reached within a specific driving or walking distance or time. Creating areas within a half-mile walking distance of schools will show places where there are likely large numbers of student pedestrians.
- For Input layer, click Layer and choose the PUSD Schools layer. For Travel mode, choose Walking Distance and change Cutoffs to .5 miles.
If school areas overlap, you want to keep them as distinct features. That way, you'll still be able to calculate the number of accidents in each area.
- For Overlap policy, confirm that Overlap is chosen. For Result layer name, type Half-Mile Walking Distances from Schools and add your name or initials.
- Click Run.
The tool may take a few moments to run. After it finishes, the walk-time areas are added to the map. Most are centered around a school. You'll rearrange the order of layers so the walk-time areas appear under the schools and accidents layers.
- In the Layers pane, drag the Half-Mile Walking Distances from Schools layer under the Traffic Collisions layer.
You'll also change the layer symbology to make the areas more transparent and have a white color that matches the schools.
- If necessary, click the Half-Mile Walking Distances from Schools layer to select it. On the Settings toolbar, click Styles. For Location (single symbol), click Style options.
- Click Symbol style and change the Fill transparency to 75 percent.
- For Fill color, click the white color from the recent colors group. For Outline color, choose No color.
- Click Done twice.
The new symbology is applied to the map.
Some school areas have no pedestrian or cyclist accidents, while others have a significant amount. At the same time, the area with the highest density of accidents is not within any school area. Adding more information beyond a heat map has provided essential context for policymakers.
Find the most dangerous school areas
You could stop your analysis here, and use this map as grounds to implement a policy that encompasses all school zones. Changing street signs and adding bicycle lanes in these areas may reduce accidents near schools.
However, sometimes a city does not have enough funds to enact new policy for every location. Many Pasadena school zones have few accidents, so policies in these areas may have little effect. Instead, policymakers want to focus their efforts on areas that need it most.
You'll calculate the number of accidents within each school zone and filter the layer to show only the five most dangerous zones. Then, policymakers can prioritize these zones over zones that are already relatively safe.
- On the Settings toolbar, click the Analysis button and choose Tools. Expand the Summarize Data group and click the Summarize Within tool.
This tool summarizes the number of point features within a polygon feature.
- For Input features, click Layer and choose Traffic Collisions. For Summary polygon layer, choose Half Mile Walking Distances from Schools.
You only want to know the count of points in each polygon, so you don't need to add any other statistics or group by an attribute field.
- For Result layer name, type Five Most Dangerous School Zones and add your name or initials.
- Click Run.
The tool runs and the layer is added to the map. The information about the number of accidents in each school zone is located in the layer's table.
- In the Layers pane, for Five Most Dangerous School Zones, click Options and choose Show Table.
- For Count of Points, click the Options button and choose Sort descending.
The table is sorted so that school zones with more accidents are shown first. The first five school zones have accidents totaling 132, 127, 92, 77, and 70, respectively.
The sixth-highest school zone has 65 accidents, which is not far from the fifth highest. With this information, you might consider expanding policy to include this school zone as well. Alternatively, depending on your city's resources, you may want to limit policy to focus only on the three most dangerous school zones, which have a much higher number of accidents than the fourth.
For this scenario, you'll continue to focus on the five most dangerous school zones. You'll filter the layer to show only these zones.
- Close the table. On the Settings toolbar, click the Filter button.
- In the Filter window, click Add expression and create the expression Count of Points is at least 70.
This expression will filter the layer to show only school zones with at least 70 accidents. Because the fifth most dangerous school zone has 70 accidents, only the top five will be shown.
- Click Save.
All five of the most dangerous school zones are relatively close to one another. Two of the most dangerous zones almost overlap entirely, which means the city can increase safety for both schools with many of the same policy decisions.
The default drawing style of the dangerous school zones layer includes a point sized proportionally to the number of accidents in the zone. This symbol distracts from your other point data, so you'll change the drawing style.
- On the Settings toolbar, click Styles. For Choose attributes, delete Count of Points. For Location (single symbol) click Style options.
The drawing style changes. The dangerous school zones are now shown with a single fill color. You'll remove the fill color and change the outline.
- Click Symbol style. Change the fill color to No color and the outline color to white (#FFFFFF) with 0 percent transparency.
- Click Done twice.
Clean up the map
Lastly, you'll rename some of the layers to remove your name or initials or add clarity. You'll also remove any unused layers. Then, you'll save the map.
- In the Layers pane, for the Five Most Dangerous School Zones layer, click Options and choose Rename.
- Remove your name or initials from the layer name. Additionally, remove any underscores between words. Click OK.
- Rename the Half Mile Walking Distances from Schools layer the same way.
You'll also rename the PUSD Schools layer. Users may not be familiar with the acronym, and the school district is less important than the geographic location of the schools.
- Rename PUSD Schools to Schools.
You did not use the hot spots layer in your policy map. You'll remove this layer (it will still exist in your account's contents if you want to use it).
- In the Layers pane, for Traffic Collision Hot Spots, click the Options button and choose Remove.
The Remove window appears. It asks you to confirm whether you want to remove the layer.
- On the Contents toolbar, click Save and open and choose Save As.
- In the Save Map window, set the following parameters:
- For Title, type Pasadena Traffic Collisions.
- For Tags, type Traffic, Collisions, Pedestrians, Bicycles, Schools, Pasadena, and California. Press Enter
- For Summary, type This map displays traffic collisions in Pasadena, California.
- Click Save.
You've created a map that highlights five school zones that would benefit from policy intervention. Instead of only showing data point locations, your map takes a position on which areas are in the most need of help. Depending on how you want to share the map with the community, your next steps could be to build an app using one of the ArcGIS Instant Apps templates, or to create a story using ArcGIS StoryMaps. To see how these are built, see Create an app or Get Started with ArcGIS StoryMaps
Policy mapping is about using GIS to discover problems around you, understand them from a geographic perspective, investigate data, personalize your understanding of the issues involved, view possible points to intervene, and track progress in improving the situation. You can take the practices you learned in this tutorial and apply them to any policy map you may want to make. Start by defining your subject. Then, find authoritative spatial data relevant to the subject. Add more data for context and analyze patterns. From traffic accidents to demographic distribution, similar techniques apply.