Create a layer from a .csv file
In this section, you will create a layer from an existing .csv file. You have been provided with a .csv file with data on all the public high schools in the city and whether the school currently has an arts program. You will explore and add this data to the map as a feature layer.
- Download the .csv file Detroit_Schools.csv.
- Open Detroit_Schools.csv in Microsoft Excel or another program like Google Sheets that can read tabular data.
The file contains spatial information about the schools, such as their x,y coordinates and address, and other important attribute details, like the school's name, their phone number, and whether they have an arts program.
Note:
To learn more about x,y coordinates, see the GIS Dictionary definition for coordinates.
- Open a new browser tab or window. Sign in to your ArcGIS organization account.
- If necessary, on the top ribbon, click Content.
- Click the New item button.
- In the New item window, in the Drag and drop your file or choose an option section, click Your device.
- Browse to the folder where you saved the Detroit_Schools.csv file. Click the file and click Open.
- In the How would you like to add this file page, ensure Add Detroit_Schools.csv and create a hosted feature layer or table is selected and click Next.
The Fields page appears. On the page, you can set the type of data you will store for each field.
The following is a description of each field type:
- Double—Numbers with decimal places
- Integer—Whole numbers from -2,147,483,648 to 2,147,483,647 (long integer)
- String—Any sequence of characters
The Type value that was automatically selected for each field is correct so you will continue.
- Click Next.
The Location settings page appears.
- Confirm that Latitude is set to Y and Longitude is set to X and click Next.
- On the next page, enter the following:
- For Title, type Public Schools in Detroit and add your name or initials.
- For Tags, type community mapping, Detroit, schools, and press Enter after each word.
- For Summary, type This layer contains the locations of public schools in Detroit, Michigan, their address, phone number, and whether the school has an arts program.
- Click Save.
The layer is created and the item page for the layer appears.
Next, you will add the new layer to a map.
Add a layer to a new map
You will add the layer you created from a .csv to a new map.
- On the top ribbon, click Map.
A new map appears in Map Viewer with the Layers pane open.
Map Viewer includes two vertical toolbars—the Contents (dark) toolbar and the Settings (light) toolbar. Use the Contents toolbar to manage and view the map contents and work with the map. Use the Settings toolbar to access options for configuring and interacting with map layers and other map components.
- If necessary, click the Expand or Collapse button at the bottom of each toolbar to expand or collapse them.
- In the Layers pane, click Add.
The Add layer pane appears.
- In the list of results under My content, for your Public Schools in Detroit layer, click the Add button.
The layer adds to the map.
Next, you will style the schools by whether they have an arts program or not.
- In the Add layer pane, click the back arrow. In the Layers pane, ensure the Public Schools in Detroit layer is selected.
- On the Settings toolbar, click Styles. In the Styles pane, under Choose attributes, click Field.
- Choose Arts_Program and click Add.
The layer updates to show which schools have an arts program and which do not.
- In the Contents pane, click Save and open and click Save as.
- In the Save map window, enter the following:
- For Title, type Community murals map, and add your name or initials.
- For Tags, type community mapping and murals, pressing Enter after each word.
- For Summary, type Map showing public, community murals that reflect the local community's identity and experiences.
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.
- Click Save.
Add data from ArcGIS Living Atlas of the World
Next, you will learn how to add data from the ArcGIS Living Atlas of the World. ArcGIS Living Atlas is a collection of geographic information from around the globe. It includes maps, apps, and data layers to support your GIS projects.
- In the Layers pane, click Add.
The Add layer pane appears.
- In the Add layer pane, click My content and choose Living Atlas.
- In the search bar, type acs race and press Enter.
- In the search results, for the ACS Race and Hispanic Origin Variables - Boundaries layer, click the Add button.
The layer adds to the map.
The map zooms to Detroit, Michigan.
- Close the Search result pop-up or window.
- In the Layer pane, click the back arrow.
In the Layers pane, the ACS Race and Hispanic Origin Variables - Boundaries group layer is collapsed. Group layers are like folders that contain multiple layers. You will expand the group layer and select the Tract layer to configure it.
- Expand the ACS Race and Hispanic Origin Variables - Boundaries group layer and click the Tract layer to select it.
The U.S. Census Bureau reports data by various political and statistical geographic units. The entire country contains states, states contain counties, counties contain tracts. Census tracts are statistical subdivisions of a county that aim to represent about 4,000 people who live in them.
Note:
To learn more about U.S. Census Bureau geographic units, see United States Census Geography.
ArcGIS Living Atlas layers often contain information for the entire country. You are only interested in making a map specific to the area around your city. You will set up a filter to only show census tracts in Wayne County, the county where Detroit is located. Next, you will open the attribute table for the Tract layer to better understand which attribute you will use to create the filter.
- In the Layers pane, click the Options button for Tract and choose Show table.
The attribute table for the Tract layer appears.
- In the attribute table for the Tract layer, scroll to the right until you see the County field.
The County attribute contains the name of the county each census tract is in. You are interested in the tracts that are in Wayne County, the county where Detroit, Michigan, is located.
- On the Settings (light) toolbar, click Filter.
- In the Filter pane, click Add new.
There are three parts to build an expression. First, you will choose a field to use for the expression. Next, you will specify the operator, such as is, is not, includes, excludes, or contains. Finally, you will choose the value. Since you want to filter your map for all the tracts that are in Wayne County, you will build an expression where the field is County, the operator is set to is, and the value is Wayne County.
- On the first drop-down menu, click the drop-down arrow. In the Replace field window, choose County.
- For the third drop-down menu, click the drop-down arrow. In the search bar, type Wayne. In the list of results, choose Wayne County.
The expression is configured.
- At the bottom of the Filter pane, click Save.
Now, only tracts within Wayne County are visible on the map.
Next, you will reorder the map layers so that you can view the school points on top of the race and ethnicity tract layer.
- In the Layers pane, drag the Public Schools in Detroit layer above the ACS Race and Hispanic Origin Variables - Boundaries layer.
The Public Schools in Detroit layer is now visible above the ACS Race and Hispanic Origin Variables - Boundaries layer.
Before you continue further with building the map, you will save the map.
- On the Contents toolbar, click Save and open and click Save to save the map.
Prepare a table for map data
In this section, you will prepare a .csv file from scratch and convert it into a map layer. To convert a list of locations into points on a map, the list first needs to be reformatted as a table, for example as an .xlsx or .csv file, or a Google Sheets document. In this tutorial, you will use Microsoft Excel to prepare the table, but you are welcome to use another software that can save a .csv file.
- Open Microsoft Excel.
First, you will use the first row of the table as field names.
- In each column of the first row, type the following field names:
- Title
- Y
- X
- ImageURL
- Go to the Detroit Mural Map website.
- Click the first mural in the exhibit titled Mama Said Produce.
The page for Mama Said Produce appears. The page includes information about the mural, including the artist, links to images of previous versions of the mural, the date it was created, and where it is located. You want to include this mural as the first record in the spreadsheet.
You have four field names in the spreadsheet. The title will be the mural title, Mama Said Produce.
For location data, you are interested in the coordinate location of the mural. Coordinates are typically listed with latitude, or the y-coordinate, listed first, followed by the longitude, or x-coordinate, second.
- In the Excel document, for Title, type Mama Said Produce. For Y, type 42.3486035644434. For X, type -83.03956673172378.
Next, you want to include an image of the mural. You will copy the image URL to add to the table.
- On the web page, locate and highlight the image URL and press Ctrl+C to copy the URL to your computer's clipboard.
- In the Excel table, in the second row, click the empty cell for ImageURL, and press Ctrl+V to paste the URL.
- Add https:// to the beginning of the URL.
You have prepared data for the first point of data on the map.
Another way you can obtain coordinate information is by using Map Viewer to search an address and use the Location tool to determine the coordinates.
- On the Mama Said Produce web page, click the browser's back button to return to the previous web page.
- On the home page of the Detroit Mural Map page, click the second mural listed, Untitled [Ford Mustang, "67 FAST BK"].
- On the Untitled [Ford Mustang, "67 FAST BK"] page, scroll down to locate the address. Under the Spatial Coverage section of the page, the address is listed: SE side of 1535 Alfred St.
- In the map, click the Search tool.
- In the search bar that appears, type or copy and paste 1535 Alfred St, Detroit, MI and press Enter.
The map zooms in to the address you searched.
- In the Layers pane, click the visibility button to hide the Tract layer.
- On the Settings (light) toolbar, click Map tools and choose Location.
The Location tool appears.
- Expand the Location tool and click the Capture mode button.
The capture mode is now activated.
- On the map, click near the search result.
The coordinates for the point you click appear in the Location tool.
The Location tool lists the x-coordinate followed by the y-coordinate.
- In the Excel table, enter the following for the third row:
- For Title, type Untitled [Ford Mustang, "67 FAST BK"].
- For Y, type 42.348868.
- For X, type -83.039287.
- For ImageURL, use what you have learned to copy the image URL you want to add to the map.
- Use what you have learned to add more murals so that you have data for 10 murals.
- When you are finished, on the ribbon, click File and click Save As. Choose the folder you want to save the table to.
- In the Save As window that appears, for File name, type murals. For Save as type, choose CSV UTF-8, and click Save.
Create a layer from the prepared table
Previously, you created a layer from a .csv file from the Contents page in ArcGIS Online. You can also create a layer from a .csv file in Map Viewer in the Layers pane.
- If necessary, sign in to ArcGIS Online and open the Community murals map in Map Viewer.
- In the Layers pane, click the Add drop-down button and choose Add layer from file.
- In the Add Layer window, click Your device. Browse to and click the murals.csv file and click Open.
- Click Next three times.
- In the How will murals.csv be added page, enter the following:
- For Title, type Public murals and add your name or initials.
- For Tags, type community, public, murals, pressing Enter after each word.
- For Summary, type Location of public murals and includes URL to images.
- Click Create and add to map.
The layer is created and added to the map.
Next, you will style the points.
- In the Layers pane, ensure the Public murals layer is selected, and on the Settings toolbar, click Styles.
- In the Styles pane, under Pick a style, for Location (single symbol), click Style options.
- In the Style options pane, click the symbol under Symbol style.
- In the Symbol style window, click the Current symbol.
- Click the diamond shape symbol and click Done.
- For Fill color, choose black.
- In the Layers pane, click the layer visibility button for the Tract layer.
The style updates on the map.
Configure pop-ups
Next, you will style the Public murals layer pop-up to show the mural title and an image of the mural.
- On the Settings toolbar, click Pop-ups.
The Pop-ups pane and a preview of the pop-ups for the Public murals layer appears.
The default pop-up configuration includes the layer name and mural title in the pop-up title and lists the attributes as a table. If you are planning to share this map with others, it is helpful to configure the pop-up so that it contains only the most useful information to the viewer. You will configure the pop-up to be more engaging and clear.
First, you will configure the title that appears in the pop-up.
- In the Pop-ups pane, expand Title and clear the existing text.
- Click the add field button.
A list of field names appear. Recall that when you were working in the spreadsheet, you set up the first field name to be Title. You will choose the Title field name to be the pop-up title. For each pop-up you open, the pop-up title will show the mural title that you typed into the Title field name column in the spreadsheet.
- In the Add field window, choose Title.
In the pop-up preview, the title updates.
Next, you want to configure the contents of the pop-up. A table of the attributes may not be very useful information. You already have the mural title in the pop-up title, so it doesn't need to be listed again in the contents. The coordinates are also not necessary. You will delete the field list.
- For Fields list, click Options and choose Delete.
Next, you add an image to the pop-up to show a preview of the mural. You can do this by setting the image to show the image URL you entered in the spreadsheet.
- Click Add content and choose Image.
- In the Configure image window, for URL, click the add field button.
- In the Add field window, choose ImageURL and click Done.
The pop-up preview updates with the pop-up configuration.
- Save the map.
- Continue exploring the map, turn layers on and off, open pop-ups, and answer the following questions:
- What do you notice about characters and themes of the murals? How does it apply to the demographics of the communities they are located in?
- Which schools might benefit from an arts program?
- Which schools with arts program have an opportunity to design public art?
- As neighborhood demographics may change in the future, which areas will be important to have public art and murals to help retain the history and experiences of the communities that are there now?
- Why do you think it is important to have public art and murals that reflect the communities they are located in?
In this tutorial, you created a map that included data from ArcGIS Living Atlas, from a provided .csv file, and from a .csv file you created. By visualizing three layers of data on a map, you can better recommend which schools and areas could benefit from a new arts program or start a community mural initiative that would be reflective of the local community's cultural heritage and identity.
You can find more tutorials in the tutorial gallery.