In the previous lesson, you joined your homeless data to a layer of the United States. You can use this layer to map homelessness variables in North Dakota and the rest of the country. To share your results as widely as possible, you will publish your layer to ArcGIS Online.
Copy the layer to a new feature class
The current layer cannot be published for two reasons. First, it is already a published feature service on ArcGIS Online. Second, you cannot publish a layer if all or part of its table is from a data source unsupported by ArcGIS Online (such as Microsoft Excel or a similar spreadsheet program). You can bypass both problems by copying the layer as a new feature class, which will preserve the data but change the source to a publishable file type.
- On the ribbon, click the Analysis tab. In the Geoprocessing group, click Tools.
The Geoprocessing pane appears.
- In the Geoprocessing pane, search for and choose the Copy Features tool.
- For Input Features, choose USA_States_Generalized.
- Click inside the Output Feature Class box to see the full path.
The new feature class will be saved inside the project’s geodatabase, Homelessness.gdb.
- In the Output Feature Class box, type USA_States.
- Click Run.
A new layer is added to your map.
- In the Contents pane, right-click USA_States_Generalized and choose Remove.
- Right-click the new USA_States layer, point to Design, and choose Fields.
Another benefit of exporting data is that fields that are not visible are not copied to the new dataset. The FID and Shape fields were not visible but were still copied because they are mandatory fields managed by the software.
Clean up the new layer
Before you publish data, it should be as clear and concise as possible. You have already removed some fields to show only the data you intend to use, but you can also make this data easier to read.
When the data was joined from your spreadsheet, prefixes were added to the field names to indicate the source of each field. Field aliases act as display names for fields and can include spaces and hyphens, while field names cannot.
- In the Fields table, double-click the cell for STATE_NAME in the Alias column. Change the alias to State.
- Change the aliases of the following fields in the same way:
- Sheet1__Change: Homeless Change (2012-13)
- Sheet1__Pop13: Population (2013)
- Sheet1__Homeless13: Homeless Count (2013)
- Uncheck visibility for the following fields:
- Click Save on the ribbon and close the fields view.
- Open the attribute table of USA_States to confirm your changes. The headers for the columns now show their short aliases instead of their long field names.
You know the total population and the population of homeless in each state, but a single number for percentage of homeless would be more useful.
- At the top of the attribute table, click the Add Field button.
The fields view appears with a new row at the bottom.
- Assign the following values to the new field:
- Field Name: HomelessPer10000
- Alias: Homeless per 10,000
- Data Type: Short
- Click Save on the ribbon and close the fields view.
- Confirm that the new field has been added to the attribute table.
All of its values are <Null>. Next, you will calculate the values for this field.
- Right-click the column header and choose Calculate Field.
The Geoprocessing pane opens to the Calculate Field tool.
- Change Expression Type to Arcade.
- Click the appropriate fields and mathematical signs to create the expression, or copy and paste $feature.Sheet1__Homeless13 / $feature.Sheet1__Pop13 * 10000 in the HomelessPer10000 box.
The expression divides the homeless count of each state by the state's population and multiplies the result by 10,000 to create a number that is easier to read.
- Click Run. Confirm that the values were added to the Homeless per 10,000 field.
- Close the attribute table.
- On the map view, click one of the states to open a pop-up.
If your pop-up does not look similar, you may need to reset it:
- In the Contents pane, right-click USA_States and choose Configure Pop-ups.
- At the bottom of the Configure Pop-ups pane, click Reset.
- Close and reopen the pop-up.
- Close the pop-up.
Publish the layer to ArcGIS Online
You will now publish the layer as a hosted feature layer to ArcGIS Online. To transform a disk-based layer to a web-based layer, you must have a Publisher role in an ArcGIS Online organization.
- In the upper left corner of the ribbon, look for your sign in status. If it says Not signed in, click it and click Sign in.
- In the Contents pane, right-click USA_States, point to Sharing, and choose Share As Web Layer.
- Fill in the following fields:
- Name: Homelessness_YourName
- Summary: Homelessness data by U.S. state for 2013, including the change in homeless populations between 2012 and 2013. From the United States Department of Housing and Urban Development.
- Tags: Homelessness, United States, 2013, HUD
- For Layer Type, choose Feature.
- For Share with, choose Everyone.
- Click Publish.
The map is now accessible through your ArcGIS Online or ArcGIS Enterprise account. When ArcGIS Pro has finished publishing the layer, you will see a confirmation message that includes a link to manage your web map.
- Save and close ArcGIS Pro.
In this lesson, you prepared your layer for the web and published it. In the next lesson, you will use your published layer to create three maps about homelessness in the United States to show how North Dakota’s homeless problem compares to the rest of the country.