Geocode campaign contributions

First, you'll geocode, or geographically locate, a spreadsheet of addresses of political contributions from the 2017 Albuquerque mayoral campaign.

Download the CSV file

Political campaign contributions can inform who and which businesses support a candidate or political party. Contribution data is often publicly available on government websites or as physical records. In this scenario, you have acquired a CSV file of contributions for the 2017 Albuquerque mayoral campaign. By mapping the location and amount of each contribution, you'll be able to visualize where constituents for each party are concentrated across the city.

First, you'll download the CSV file of political campaign contributions. Then, you'll familiarize yourself with its contents.

  1. Download ABQ_Voter_Data.csv.
  2. Optionally, locate the downloaded CSV file and open it in a spreadsheet editor such as Microsoft Excel.

    CSV file in Microsoft Excel

    The CSV file contains the following information for 814 political contributions:

    • Address data
    • The political affiliation of the candidate who received the contribution
    • The occupation of the contributor
    • The contribution amount in United States dollars
    • Whether the contributor was an individual or business
    • The type of contribution (in this case, all contributions are monetary)

    The address data comes in two forms: the full address and individual columns for the street address, city, state, and ZIP code. When you geocode the file, you'll use the individual columns to ensure each part of the address is correctly recognized by the automated geocoding service.

  3. Close the CSV file. If prompted to save changes to the file, click Don't Save.

Geocode the CSV file

To map the CSV file, you'll geocode it. Geocoding is the process of converting a description of a location, such as an address or place name, into a coordinate that can be displayed on a map. You can geocode a CSV file or other spreadsheet of addresses when you upload it as an item in ArcGIS Online.

  1. Sign in to your ArcGIS organizational account.
    Note:

    If you don't have an organizational account, see options for software access.

  2. On the ribbon, click Content.

    Content tab

  3. Click New item.

    New item button

  4. In the New item window, click Your device. Browse to and double-click the ABQ_Voter_Data.csv file you downloaded.
  5. For How would you like to add this file, ensure Add ABQ_Voter_Data.csv and create a hosted feature layer or table is selected. Click Next.

    The next window determines how the fields in the CSV file will be included in the feature layer you create. By default, all fields will be included. Most fields will be string (text) fields, while the ContributionAmount field will be an integer (number) field. These parameters are correct.

    You can also change the display names of the fields, which determine how the field names are shown in pop-ups and charts. You'll make changes to improve legibility and presentation.

  6. For Display name, change the following names:
    • Remove the underscores from Full_Address, Address_1, Address_2, and Contribution_Type and replace them with a space.
    • Change Zip to ZIP Code.
    • Change Political_Affl to Political Affiliation.
    • Add spaces between the words for ContributionAmount and ContributorType.

    Display name parameters for the fields in the CSV file

  7. Click Next.

    Next, you'll set the parameters to geocode the addresses in the CSV files. First, you'll set the region the addresses are in.

  8. Expand Advanced location settings. For Region, choose United States.

    Region parameter under Advanced location settings

    The default address locator used by ArcGIS Online is ArcGIS World Geocoding Service. This service will be able to locate most addresses in the United States.

    Next, you'll set the fields in the CSV file that will be used to locate the addresses. You'll change the fields so that they are taken from the address, city, state, and ZIP code fields instead of the field with the full address. By using multiple fields instead of one, you'll ensure the address locator reads the location information correctly.

  9. Under Location fields, select Location information is in multiple fields.

    Location fields parameter

  10. For Address or Place, choose Address 1. For Address2, choose Address 2.

    Address fields

    The City, State, and ZIP Code fields were automatically selected.

    Geocoding consumes credits. Credits are the currency used across ArcGIS and are consumed for specific transactions and types of storage, such as storing features, performing analytics, and using premium content. The amount of credits consumed during geocoding depends on the number of features being geocoded. The Credit estimate section estimates it will take 32.60 credits to geocode the CSV file.

    Note:

    If you don't have enough credits to complete the geocoding, or if you don't want to spend credits, you can use a replacement feature layer that has already been geocoded for you. Go to Albuquerque 2017 Campaign Contributions details page and proceed to the next section of the tutorial. You may need to sign in to your ArcGIS account again.

  11. Click Next.

    Lastly, you'll add metadata about the feature layer you're creating.

  12. For Title, type Albuquerque 2017 Campaign Contributions and add your name or initials.
    Note:

    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.

  13. For Tags, add the tags voting, elections, and political parties. For Summary, type (or copy and paste) Political contributions in the 2017 mayoral election in Albuquerque, New Mexico.

    Parameters for the new feature layer

  14. Click Save.

    The feature layer is created and you go to its item page. A window confirms that 814 locations were successfully geocoded. Because there were no errors, you don't need to review the geocoded locations.

  15. In the Review locations window, click No.

Style the campaign contributions

Now that you've geocoded the political campaign contributions, you'll add them to a web map. You'll style the contributions to show both the contribution amount and the political party that received the contribution.

  1. On the Albuquerque 2017 Campaign Contributions item page, click Open in Map Viewer.

    Open in Map Viewer button

    The layer is added to a new web map centered around Albuquerque, New Mexico. Each contribution is displayed as a point.

    Default map

    Though you've mapped the contributions, the default style doesn't tell you much about them. To learn more about the data, you'll change its style so that contributions have different appearances based on the dollar amount of the contribution and the political party they were for.

    You'll also rename the layer to remove unneeded information. When you save the map, you'll include information about the year and city in the map title, so the layer can have a simpler title.

  2. In the Layers pane, for Albuquerque 2017 Campaign Contributions, click the Options button.

    Options button in the Layers pane

  3. In the options menu, choose Rename. Rename the layer to Campaign Contributions and click OK.

    Next, you'll style the layer based on contribution amount and political affiliation.

  4. On the Settings (light) toolbar, click Styles.

    Styles button on the Settings toolbar

  5. In the Styles pane, under Choose attributes, click Field.

    Field button

  6. In the Select fields window, select Political Affiliation and Contribution Amount. Click Add.

    The fields are added and the layer style automatically changes. Now, the size of each point reflects the dollar amount of the contribution and the color represents the political affiliation. In the 2017 mayoral election, there were two political parties represented, Republicans and Democrats. By default, Republican contributions are styled in red and Democrat contributions in blue, reflecting the colors commonly associated with each party.

    Contributions by affiliation and amount

Refine the style

The style conveys useful information, but could be improved. Contributions overlap or cover each other completely, making some contributions difficult or impossible to see. You'll add transparency to the symbols to make it possible to see the covered contributions.

  1. In the Styles pane, for Types and Size, click Style options.

    Style options button for the Types and Size style

    You can choose to change the style for political affiliation (Types) or contribution amount (Counts and Amounts). You'll add transparency to the symbol color, so it's the political affiliation symbol you want to change.

  2. For Types (unique symbols), click Style options. Click the Symbol style button.

    Symbol style button

  3. In the Symbol style window, set Fill transparency to 30 percent.

    Fill transparency parameter

    The transparency is applied, making it possible to see where symbols are overlapping. For clarity, you'll give each symbol a unique outline without transparency so individual symbols stand out more.

  4. Close the Symbol style window. In the Style options pane, click the REPUBLICAN symbol.

    REPUBLICAN symbol

  5. In the Symbol style window, point to the Fill color button.

    A tooltip provides the hexadecimal (#) code for the color. The code is #ED5151.

    Fill color with tooltip

    You'll use the same color for the outline, but remove the outline's transparency.

  6. Click the Outline color button. In the Select color window, for the hexadecimal code (#), type ed5151.

    Hexadecimal code for the outline color

  7. Close the Select color window. In the Symbol style window, change Outline transparency to 0 percent.

    You'll style the DEMOCRAT symbol similarly.

  8. Close the Symbol style window. In the Style options pane, click the DEMOCRAT symbol.

    The hexadecimal code for this symbol's fill color is #149ECE.

  9. Click the Outline color button and change the outline color's hexadecimal code (#) to 149ece. Close the Select color window.
  10. Change Outline transparency to 0 percent. Close the Symbol style window.

    Lastly, you'll change the name of each symbol. Because of the way the data in the CSV file was formatted, the symbol names are in all capital letters. You'll change them to title case.

  11. In the Style options pane, click REPUBLICAN and type Republican. Click DEMOCRAT and type Democrat.

    Symbol titles

    Note:

    The number next to each symbol indicates the number of times that symbol is used on the map. Based on this information, there are 501 Republican contributions and 313 Democrat contributions.

  12. At the bottom of the Style options pane, click Done.

    Map with improved layer style including transparency and outlines

    The layer is now styled to show where the largest contributions came from for each candidate and how contributions compare between parties.

Change the map context

You can also improve the presentation of your data by changing and adding contextual information to the map. First, you'll update the basemap to one with a simpler appearance to avoid unneeded information from distracting from the campaign contributions. Then, you'll add the city boundary of Albuquerque.

  1. On the Contents (dark) toolbar, click Basemap.

    Basemap button on the Contents toolbar

  2. In the Basemap pane, click Light Gray Canvas.

    Light Gray Canvas basemap

  3. Close the Basemap pane.

    The light gray background makes the contributions easier to see.

    Map with Light Gray Canvas basemap

    Next, you'll add a city boundary to help users focus on the area that's important to the campaign.

  4. On the Contents toolbar, click Add and choose Browse layers.

    Browse layers option in the Add menu

    You'll search for the city boundary layer by searching all content shared on ArcGIS Online.

  5. In the Browse layers pane, click My content and choose ArcGIS Online.
  6. In the search bar, type Albuquerque City owner:Esri_Tutorials.
    Tip:

    By adding owner: and the name of an account, you can narrow the search results to only those owned by that account.

  7. In the list of results, for Albuquerque City Boundary, click Add.

    Add button for the Albuquerque City Boundary layer

    The layer is added to the map. It shows the official city boundary of Albuquerque, which stretches from the east of the Sandia Mountains to the Volcano Cliffs on the west mesa.

    Map with Albuquerque City Boundary layer

    Your map is finished, so you'll save it.

  8. On the Contents toolbar, click Save and open and choose Save as.

    Save as option

  9. In the Save map window, add the following information:
    • For Title, type Albuquerque Political Campaign Contributions.
    • For Tags, add the tags voting, elections, and political parties.
    • For Summary, type Political campaign contributions for the 2017 mayoral election in Albuquerque, New Mexico.
  10. Click Save.

You've geocoded a CSV file of campaign contributions and mapped them with an appropriate layer style to show where the largest contributions are located throughout the city. This information will provide your candidate with a good idea of the most important neighborhoods to target messaging for contributions to their own campaign. But what does your candidate know about the contributors? To help them understand more about where contributions are coming from, you'll create a chart that breaks down contributions by type.


Chart contributions by type

The campaign contributions you geocoded include nonspatial data, or data that isn't related to geographic location. Previously, you changed the layer style to emphasize some of this nonspatial data (specifically, political affiliation and contribution amount). The candidate would also like to know whether contributions are coming from businesses or individuals. This information will help them target their campaign messaging.

Adjusting the layer style to show a third field in addition to the two you're already displaying isn't possible with the available style options. Instead, you'll create a chart to visualize contributor type. You'll also manage layer pop-ups so users can quickly view important information about individual contributions.

Create a chart

First, you'll chart the amount of contributions coming from businesses and the amount coming from individuals.

  1. On the Contents toolbar, click Layers.

    Layers button on the Contents toolbar

    The Layers pane appears.

  2. In the Layers pane, click the Campaign Contributions layer to select it.
  3. On the Settings toolbar, click Configure charts.

    Configure charts button on the Settings toolbar

  4. In the Charts pane, click Add chart and choose Bar chart.

    Bar chart option in the Add chart menu

    An empty bar chart appears. To create the chart, you'll choose the field you want to show.

  5. In the Data pane, for Category, choose Contributor Type.

    Category parameter in the Data pane

    A bar chart is created. There are two contributor types: business and individual. By default, the types are aggregated by count, meaning the chart shows the total number of contributions by each type.

    Chart showing the number of contributions by type

    Individuals made significantly more contributions than businesses did. However, this chart doesn't account for the amount of money that was contributed. It's possible that individuals made a large number of small contributions, while businesses made a small number of large contributions. You'll adjust your chart to show the total contribution amount instead of the number of contributions.

  6. For Aggregation, choose Sum.
  7. For Numeric fields, click Select numeric fields. Choose Contribution Amount and click Done.

    Aggregation and Numeric fields parameters

    The bar chart updates to show the total amount of contributions, rather than the total number. The difference between businesses and individuals is smaller, though individuals still contributed significantly more. Your candidate will probably want to prioritize their messaging toward individuals, but they shouldn't ignore businesses completely.

    Chart showing the contribution amount by type

    Your candidate also wants to know if there is a significant difference in contributor types by political party. You'll adjust the chart to split each bar by affiliation.

  8. For Split by, choose Political Affiliation.

    Split by parameter

    The chart updates.

    Chart showing contribution amount by type and affiliation

    The chart confirms what your map seems to show: Republicans received a significantly higher amount of contributions than Democrats. While Republicans received most of their contributions from individuals, they also received a significant amount from businesses. By contrast, Democrats received almost no contributions from businesses. Your candidate's political affiliation might determine whether they target messaging toward businesses or not.

Improve the chart

You'll make some adjustments to the chart to improve its presentation. Then, you'll export it as an image.

  1. Turn on Show data labels.

    Show data labels parameter

    On the chart, each bar is labeled with its total amount. In this case, this option is useful because it reveals that Democrats did receive some contributions from businesses (550 dollars), even though the chart's scale makes it appear as though they received none.

  2. Click the General tab.

    General tab

    On this tab, you can change the titles of the chart and its axes. You'll give the chart simpler titles to make it more legible.

  3. Change the following parameters:
    • For Chart title, change the title to Contribution Amount by Type and Party.
    • Turn off X-axis title.
    • For Y-axis title, change the title to Total Amount.

    General tab parameters

    Next, you'll adjust the length of the axis labels. The Business/Group label is cut off because it exceeds the label character limit. By increasing the length, you'll display the entire label.

  4. Click the Axes tab.

    Axes tab

  5. For X-axis, for Label character limit, type 20.

    Label character limit parameter

    Lastly, you'll change the legend so the political parties are listed in title case rather than all capital letters.

  6. Click the Series tab.

    Series tab

  7. For Series, click DEMOCRAT.

    DEMOCRAT button

  8. In the Series style window, for Label, type Democrat. Close the Series style window.
  9. Change the REPUBLICAN label to Republican and close the Series style window.

    The chart is finished. You're ready to export it as an image.

    Final chart

  10. On the chart pane toolbar, click the Export button and choose Export as Image.

    Export as Image option in the Export menu

    The chart is downloaded to your computer as a PNG image.

  11. In the Series pane, click the Back button.

    Back button

    You return to the Charts pane. The chart you created is listed.

    Tip:

    If you want to edit the chart again, click the options button next to its name and choose Edit.

  12. On the Contents toolbar, click Charts.

    Charts button on the Contents toolbar

    The Layers pane is replaced by the Charts pane. You can access your chart from this pane, too.

  13. On the Contents toolbar, click Layers. Close the Charts pane and the pane showing your bar chart.

Configure pop-ups

Charts aren't the only way to display a map's nonspatial information. Layers also have pop-ups, which appear when you click a feature on the map. A pop-up displays attributes about a selected feature. By configuring pop-ups, you can quickly view information about individual contributions.

  1. On the map, click any campaign contribution feature.

    Default pop-up

    The pop-up doesn't display information about the contribution. Instead, it displays information about Albuquerque. The pop-up you see is actually the pop-up for the city boundary layer. You'll want to turn off this pop-up so users see information about campaign contributions instead.

    The bottom of the pop-up says 1 of 2. (Depending on where you clicked, it may say 1 of 3 or more.) This number refers to the number of pop-ups at the location you clicked. You'll look at the second pop-up at this location.

  2. In the pop-up, click the Next button.

    Next button in the pop-up

    The next pop-up is displayed. It shows information about the campaign contribution. All of this information comes from the CSV file you geocoded.

    Pop-up for the campaign contribution

    Not all of the information in this pop-up is useful. All of the contributions are in Albuquerque and all of them are monetary, so this information is redundant. It's also not necessary to display the address multiple times. You'll remove the unneeded information from the pop-up.

  3. In the Layers pane, confirm that Campaign Contributions is selected. On the Settings toolbar, click Pop-ups.

    Pop-ups button on the Settings toolbar

    First, you'll change the pop-up's title. The current title is the original name of the layer, which isn't useful. You'll change it to the full address of the contribution.

  4. In the Pop-ups pane, click Title.

    Title button in the Pop-ups pane

  5. Delete the title text. Click the fields button.

    Fields button for the pop-up title

  6. In the Add field window, choose Full Address.

    Now, the pop-up title will display the address of the campaign contribution. Next, you'll remove unneeded fields from the pop-up.

  7. Click Fields list.

    Fields list button in the Pop-ups pane

    The list expands. You'll remove the address field because the address is in the title.

  8. For Address 1, click the remove button.

    Remove button for Address 1

  9. Remove the following fields:
    • Address 2
    • City
    • Contribution Type
    • Full Address
    • State
    • ZIP Code

    Now, only four fields remain. On the map, the pop-up automatically updates based on your changes.

    Final pop-up

    You've mapped or charted contribution amount, contributor type, and political affiliation. The remaining field of interest is Occupation, which shows the occupation of the person who contributed or, in the case of businesses, the type of business.

    Tip:

    For an optional challenge, to test what you've learned, try creating a chart that shows the total amount of contributions by occupation. Which occupations contributed the most to campaigns?

    Lastly, you'll turn off the pop-up for the city boundary.

  10. In the Layers pane, click Albuquerque City Boundary to select it.

    The Pop-ups pane automatically updates to show options for the selected layer's pop-up.

  11. In the Pop-ups pane, turn off Enable pop-ups.

    Enable pop-ups option

  12. Close the Pop-ups pane. On the map, click any campaign contribution feature.

    Now, only the pop-up for the campaign contribution appears. The city boundary pop-up has been turned off.

  13. Close the pop-up. Save the map.

In this tutorial, you geocoded political campaign contributions and added them to a web map. Then, you styled them by political affiliation and contribution amount. Lastly, you created a chart showing contributor type and configured pop-ups to show relevant information. The result is a map that combines spatial and nonspatial data to give an in-depth picture of campaign contributions in Albuquerque, New Mexico. Your candidate can use this map to identify important areas to canvass and ways to best target messaging so that they can ensure a successful campaign.

This tutorial covered only some of the ways a web map could be used to help a campaign. To learn more about what you can do in ArcGIS Online, try the following tutorials:

You can find more tutorials in the tutorial gallery.