Skip To Content

Prepare and publish a layer

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.

  1. On the ribbon, click the Analysis tab. In the Geoprocessing group, click Tools.

    The Geoprocessing pane appears.

  2. In the Geoprocessing pane, search for and choose the Copy Features tool.
  3. For Input Features, choose USA_States_Generalized.
  4. Click inside the Output Feature Class box to see the full path.

    Full path of output feature class in the Copy Features tool

    The new feature class will be saved inside the project’s geodatabase, Homelessness.gdb.

  5. In the Output Feature Class box, type USA_States.
  6. Click Run.

    A new layer is added to your map.

  7. In the Contents pane, right-click USA_States_Generalized and choose Remove.
  8. 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.

  1. In the Fields table, double-click the cell for STATE_NAME in the Alias column. Change the alias to State.
  2. Change the aliases of the following fields in the same way:
    • Sheet1__ChangeHomeless Change (2012-13)
    • Sheet1__Pop13Population (2013)
    • Sheet1__Homeless13Homeless Count (2013)
  3. Uncheck visibility for the following fields:
    • L0USA_States_Generalized_STATE_ABBR
    • Sheet1__State
    • Sheet1_ObjectID
    • Shape_Length
    • Shape_Area

    Fields view showing all rows as edited except for Shape

  4. Click Save on the ribbon and close the fields view.
  5. 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.

    Attribute table showing aliases instead of 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.

  6. At the top of the attribute table, click the Add Field button.

    Add Field option on the attribute table

    The fields view appears with a new row at the bottom.

  7. Assign the following values to the new field:
    • Field Name: HomelessPer10000
    • Alias: Homeless per 10,000
    • Data Type: Short
  8. Click Save on the ribbon and close the fields view.
  9. 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.

  10. Right-click the column header and choose Calculate Field.

    Calculate Field option in the context menu of the Homeless per 10,000 column of the attribute table

    The Geoprocessing pane opens to the Calculate Field tool.

  11. Change Expression Type to Arcade.
  12. 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.

  13. Click Run. Confirm that the values were added to the Homeless per 10,000 field.
  14. Close the attribute table.
  15. On the map view, click one of the states to open a pop-up.

    Pop-up showing correct attribute values


    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.
  16. 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.

  1. 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.

    Sign in status expanded to show Sign In option

  2. In the Contents pane, right-click USA_States, point to Sharing, and choose Share As Web Layer.
  3. Fill in the following fields:
    • NameHomelessness_YourName
    • SummaryHomelessness 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.
    • TagsHomelessness, United States, 2013, HUD
  4. For Layer Type, choose Feature.
  5. For Share with, choose Everyone.

    Share As Web Layer pane with all fields filled in

  6. 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.

  7. 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.