-
Notifications
You must be signed in to change notification settings - Fork 0
/
03-Geocoding.Rmd
133 lines (79 loc) · 13.4 KB
/
03-Geocoding.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Geocoding
At this point, you should be familiar with the ArcGIS Online Mapping interface. You are now ready to start adding data layers of your own to a basemap. Neighborhood Assignment #3 asks you to create a map of the most important/influential/powerful/interesting non-profit organizations in or near your neighborhood. To do this, we will need to draw upon two sources of data - the locations of the non-profits and your neighborhood boundaries. The non-profit locations and neighborhood boundaries will be two separate data layers on your map. We will need to create the non-profit locations data through a process called geocoding. The census tract boundaries of your neighborhood have been provided to you as a layer in our class AGOL group. In the sections below, we will walk through geocoding the non-profit locations and accessing the neighborhood boundaries through our class group.
## What is Geocoding
Geocoding is the process of transforming a street address to a pair of geographic coordinates on the Earth's surface (i.e., latitude and longitude), so that it can be displayed as a point on a map. You can import one street address at a time to geocode or provide multiple addresses at once in a table. Under the GIS hood, the "database side" of GIS looks up the street address in a street segments data layer and finds the pair of latitude and longitude coordinates that correspond with that street address. Those coordinates are attached as attributes to the street address you provided and plotted as point features on the map. The resulting layer of geocoded points can be stylized on a map with symbols of your choice and analyzed with geoprocessing tools.
## Preparing Data for Geocoding
Assignment #3 requires that you have at least 10 non-profits on your map, so we will go ahead and batch geocode all 10 locations at once by recording the addresses in a table. Be sure to follow the GuideStar non-profit look-up tutorial on Canvas to identify your 10 important non-profits. Once you have identified the 10 important non-profits make sure that they have physical street address.**Do NOT use PO box addresses; the geocoder will not recognize them and give you an error.**
The screenshot below demonstrates an appropriate way of formatting your non-profit data for the geocoder. Below the screenshot are a series of steps that explain how to format the table.
![Format the address data](images\addresses.png)
1. Open up a spreadsheet software of your choice.
2. Then, create a header row at the top of your spreadsheet that has cells for the name of the organization, the Address, City, State, Zipcode, and type of service the organization provides.
i. **You do not need to bold the text.** The bolding is included here to illustrate that this is a header row that AGOL will interpret as the attribute names of your data.
ii. If you use the same header names for the address components that are featured in this table, the AGOL geocoder will auto-detect the fields correctly. This will eliminate a couple of mouse-clicks from your workflow.
3. Each row will represent a non-profit that you have selected. Enter the name of the organization. Then, parse out the components of the address, starting with the street address, then the city name, the state abbreviation, and the five digit zipcode. The last column contains a description of the type of service the organization provides.
i. It is okay to use common street type abbreviations in the street name (e.g., St for Street, Ave for Avenue) because the geocoder will recognize them.
ii. The service type column is not necessary for geocoding, but it will be helpful when we style the symbology in our map. Symbology is the cartographic term for the icon or shading you use in your map to represent attributes of your data.
4. Once you have entered the address information for your non-profits, save the spreadsheet as a **CSV** file.
You are now ready to bring the table of addresses into AGOL for geocoding.
## Geocoding in AGOL
Open up Mapviewer and start with just the basemap. Feel free to change the basemap if you would like. You can also zoom into your neighborhood using any of the Zoom/Pan options or use the Search Bar. When you are ready to upload the non-profit locations, navigate to the **Add** button on the toolbar and follow the steps written out or demonstrated in the GIF below.
1. Select **Add layer from File.**
2. Find and select the CSV file that you saved with the addresses. Import the layer.
3. You will see an Add CSV Layer dialogue box. Fill out the options as follows:
i. For **Locate features by**, select the **Address or Places** radio button.
ii. Be sure you are using the ArcGIS World Geocoding Service.
iii. For the **In option**, use the drop down box and find the **United States.**
iv. Finally, review the **Field Name** from your table and **Location Name** columns in the table. Make sure that they match up. If you named the columns using the same schema in the [section above][Preparing Data for Geocoding], then they should automatically match. The table below shows how the fields in your spreadsheet should match up with the location names in the geocoder.
| Field Name | Location Name |
| ----------- | --------------|
| Name | Not Used |
| Address | Address or Place |
| City | City |
| State | State |
| Zip | Postal (or Zip) |
| Service | Not Used |
4. When you are sure that the Table Field Names and Location Field Names match up, select **Add Layer.**
After the geocoding is complete, you should see the non-profits plotted as points on the map.
![Geocoding](images\Geocoding.gif)
## Changing the Symbology
For this assignment, we are trying to create a reference map of the non-profits in the neighborhood so that we can show not only where important non-profits are located, but also the types of services the non-profits provide to the community. non-profits Therefore, we need to change the current symbols on the map - colored circles - to symbols that would reflect the type of service that the non-profit provides. This process of changing the symbology of the map is shown in the GIF above and written out below.
1. In part 1 of the Style Pane, select the field labeled Service in the drop-down menu.
2. Then select the Options button on Types in Part 2.
3. You should see all of the labels for Service appear next to the colored dots. Click on a colored dot icon, and you should see a dialogue box with other symbol options appear. Within the shape symbol type, use the drop-down menu to find symbols that would represent the services provided by the non-profits in your neighborhood.
4. When you find an icon you like, you might also want to **change the symbol size** before you move on to the next symbol.
5. When you are happy with all of your symbols, select Okay and then Done.
You should see the Contents pane contains the non-profits data layer now. If you click on the **Show Legend button** underneath the layer name, the icons and labels will appear. The highlighted area in the image below shows how you can show the icons and labels. Also, if you click on any of the icons on the map, you will see a pop-up emerge for that location like the one in the image below. All of the information in your table is contained in the pop-up. These pop-ups will be more relevant later on when we build our story maps, but for now just know that clicking on these pop-ups is a good way to quickly ascertain information about the features on your map. Now, if you are happy with your non-profits, you can now move on to the next section, where we will cover importing the neighborhood boundaries onto your map.
![Non-profit locations symbology and popups](images\popup_info.png)
## Plotting Neighborhood Boundaries
The neighborhood boundaries are saved in our class' group page. We will use the **Add** button again to add the layer from our group page. Below you will find the steps written out and a GIF that demonstrates how to carry out the steps.
1. Select **Search for Layers.** Layers in My Content will be shown first, but you should scroll through the drop-down options and select **My Groups.**
2. Scroll through the Groups layers to find your neighborhood. Click on the Plus button on the bottom right corner of your neighborhood layer to add it to the map.
3. Close out the search for layers panel when you see the neighborhood polygon populate on your map and in the Contents pane.
2. The neighborhood is a colored polygon when imported onto the map. We should change the symbology to just show the boundaries and not color the full area of the neighborhood.
3. Click on the Neighborhood layer in the Contents pane, and navigate to the button with three shapes. This is the change style button.
4. Keep the show location only option selected in part 1. In part 2, select **Options.**
5. Then, click on the symbol to change the symbology. The **Fill style** will come up first. Select **no color** option to remove color from the neighborhood area. This will leave the inside of the polygon transparent.
6. Then, select the **Outline option** and pick a color to outline the neighborhood boundaries. You might also consider changing the heaviness of the line by increasing the line width.
7. When you are happy with the style, select **Okay** and then **Done**, to get back to the map and contents pane.
8. Lastly, clean up the name of the layer in the Contents pane. On the layer, click the **three horizontal dots button** on the layer, which prompts a drop-down list of options. Select **rename** and change the name.
![Importing neighborhood boundaries](images\nhood_bounds.gif)
**NOTE:** The neighborhood boundary files follow a particular naming system: "nhood_name_cityname". If you listed multiple names for your neighborhood, the first name may only be listed in the file name for brevity. The city name may be abbreviated in some instances. If you have trouble finding your neighborhood based with this naming system, open up a new tab in your browser and go to the **group page content.** The content has been organized, so you can filter to the files that have been *categorized as neighborhood boundaries.* Scroll through the neighborhood boundaries. You should be able to see the outlines and find the one that looks like your neighborhood.
## Exporting your map as a PDF
**Update: The assignment instructions have been changed since they were first published. Because exporting the map to a PDF is a little cumbersome, you now have the option of submitting your map as a web map via a link. The instructions below will guide you through both options.**
If you click on the **Legend button** in the Content pane, you will see both layers and the detailed symbology. When you are happy with the look of your map, save the map by going to **Save button** (i.e., the disk icon) on the Toolbar. You will need to select the **Save As** option because it is the first time you are saving the map. Give the Map an informative title and a few tags when you are saving it.
![Saving your map](images\save_map.png)
The map is saved to your Content page in AGOL. For this assignment, you will also want to export the map as a PDF. This is also a multi-step process that converts your webmap to a web-app and then to a PDF file (This seems like a lot of work). The GIF below will walk you through it along with the steps that are written out below.
![Transform webmap to a web-app](images\webapp_widgets.gif)
1. Navigate to the **Share button** (the chain-link icon) on the toolbar. You can ignore the content at the top of the dialogue box. Find and click on the **Create a Webb App** button toward the bottom of the page.
2. You will be redirected to a new dialgoue box to Create a New Web App. Select the middle tab that says **WebAppBuilder.**
3. Again, you are redirected to a new dialogue box, but the information in it should look familiar. The boxes should contain the information you included when you saved your webmap. Make sure that the radio box next to the sentence: "Share this app in the same way as the map (The Social Life of Neighborhoods)" is checked. Then, scroll to the bottom of the page and click get started.
4. Navigate over to the **Widget** controller on the WebApp Interface. Scroll down the left hand panel to the empty widget place-holders. Click on one of the empty ones. You will be redirected to an array of widgets. Find and select the Print widget. Be sure to select a print option **other than Map_Only and to have the Show Legend option selected.**
5. Next, add the **legend widget** to one of the other empty widget containers.
![Print the webapp as a PDF](images\print_webapp.gif)
6. Select the Print widget icon on the map.
7. Title the map (again). Then select a layout option **other than Map_Only.** Keep the layout as PDF, and then select print.
8. When the PDF icon shows up on the print panel, select it so that it will open. You can save the PDF and submit it along with your write-up.
Your PDF map should look something like this. Make sure that all of the layers are showing up.
![PDF version of map](images\orgs_map_pdf.png)
Don't worry about the strange legend layout in the PDF or if the layout did not zoom in on the extent of your neighborhood as much as the web-map did. The webmap is saved and is what will ultimately be part of your Story Map.
You have now completed your first web-map! Way to go! In the next assignment, you'll build on these skills with a larger dataset that contains incidents of crime in the city where your neighborhood is located.