Manage data ArcGIS Online

Publish a hosted feature layer from a .csv file

You already have a .csv spreadsheet with more than five years of reported coyote activity in Oakville. You'll publish this data as a hosted feature layer.

  1. Download the .csv file to your computer and open it in a text editor such as Notepad or Microsoft Excel.
    Note:

    This file includes data downloaded from the Town of Oakville Open Data Portal (licensed under the Open Government License—Town of Oakville). The data has been modified slightly for instructional purposes.

    The data has columns for x,y coordinates and other information such as location notes, type and date of observation, and comments. You’ll add this file to ArcGIS Online to visualize the locations on a map.

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

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

  3. On the ribbon, click Content.

    Content tab

  4. Click New item.

    New item button

  5. Drag the downloaded coyotes_oakville.csv file from your computer into the New item window.

    Next you will update the details in the New item window.

  6. Ensure that Add coyotes_oakville.csv and create a hosted feature layer or table is selected and click Next.
  7. On the Fields page, leave all the fields selected and click Next.
  8. On the Location settings page, leave the default fields and click Next.
    Tip:

    Review best practices for using layers in maps that perform well on the web.

    When you add a .csv file with location information (street addresses or coordinates), the features can be located on a map. In the field table, the Field Name column lists the field names (column headings) from the .csv file. In the Location Fields column, these field names are matched to appropriate categories of address information.

  9. In the New item window, for Title, accept the default text and add your initials or name (for example, coyotes_oakville YN).
    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.

  10. For Tags, type coyotes, crowdsource, Oakville, Ontario, Canada, and press Enter.

    Title and Tags entered for the New item

    Publishing a hosted feature layer allows you to share your data in a web map or app and configure it for reuse. Hosted feature layers also allow you to edit data, which supports community contributions.

  11. Click Save.

    The item is now added and the item page appears.

Update item details and configure the layer

Once you've created your feature layer, the item page for your layer appears. On the item page, you can edit details such as a brief summary of the item, a description, and terms of use. To help others understand the purpose of your content, you'll complete the item page. You can refer to the Item Information section for improvement recommendations.

  1. On the coyotes_oakville feature layer item page, next to the thumbnail, click Add a summary. In the Edit summary box, type Reported coyote activity in the town of Oakville, Ontario Canada. and click Save.
    Tip:

    To paste text without formatting, press Ctrl+Shift+V.

    Edit summary box

  2. For Description, click Edit and copy and paste the following text:

    Reported coyote activity in the town of Oakville, Ontario Canada. This is the source data for a crowdsourcing solution being developed by the city. It has multiple purposes and audiences. The community can report coyote activity and view reports that have been reviewed for quality. City staff can view all recently reported coyote activity and collect new data in the field. City staff in the office can review and modify data for quality before sharing it with the community. This layer was created for instructional purposes only and should not be used as an authoritative resource.

  3. Click Save.
  4. For Terms of use, click Edit and copy and paste the following text:

    This layer was created for instructional purposes using a modified version of the Coyote Encounters CSV data file downloaded from the Town of Oakville Open Data Portal (https://portal-exploreoakville.opendata.arcgis.com).

  5. Click Save.
  6. On the side of the item page, for Acknowledgments, click Edit and copy and paste the following text:

    Contains information licensed under the Open Government License — Town of Oakville. (https://www.oakville.ca/data/open_data_licence.html).

  7. Click Save.

    Acknowledgments

    Now that you have a hosted feature layer with location data and corresponding attributes, you can query and update the data in ArcGIS Online. The .csv file includes columns for the x,y coordinates. ArcGIS used those coordinates to create the points in your layer, so you no longer need to keep the X and Y fields. Now that you have a hosted feature layer with location data and corresponding attributes, you can query and update the data in the portal. Next, you'll modify the layer.

  8. On the blue ribbon, click the Data tab.

    Data tab

    A table appears, showing all of the attributes for the layer.

  9. On the header of the X column, click the Menu button and click Delete.

    Delete option for X field

  10. In the Delete field window, click Delete field to continue.
  11. Delete the Y field as well.

    The field names that appear in the column headers are what end users see when they're working with features in the layer. You can provide names that are more meaningful.

  12. Click the Fields tab.

    Fields tab

  13. In the Display name column, click Encounter_type to open settings for this field.
  14. Click the Edit button next to the display name and change the name to Type of observation. Click Save.

    Edit title

    Changing the display name of a field doesn't affect the field name stored in the attribute table. You can also create a list of suggested attribute values that users can choose when adding and editing features. The table already contains four unique values for this field (Encounter, Sighting, Feeding, and Garbage), so you'll populate the list with these values.

  15. Under Domain, click Get started.
  16. In the Manage domain window, click Find values and click Next.

    A list of the four existing values is displayed.

    List

  17. Click Save.

    Now when users add a feature, they can choose one of these values from a list instead of typing their own.

  18. On the blue ribbon, click the Visualization tab to view the data on a map.

    Map

    The Visualization settings allow you to configure the feature layer style and filter data to display what users will see when the layer is added to a map.

  19. Click a feature on the map to display a pop-up.

    The pop-up includes the fields and values for the reported coyote activity. You can change the default configuration to control what information the pop-up displays. You'll update the title.

  20. On the Contents (dark) toolbar, click Layers.

    Layers on the Contents toolbar

    Tip:

    To see the names of tabs on the toolbar, click the Expand button at the bottom of the toolbar.

  21. On the Settings (light) toolbar, click Pop-ups.

    Pop-ups in the Settings toolbar

  22. Click Title and replace the text with Coyote Report.

    Title text replaced with Coyotes.

  23. Above the Contents toolbar, click Save.

    Save button

  24. On the blue ribbon, click the Settings tab. For Delete Protection, turn on Prevent this item from being accidentally deleted.

    Delete protection enabled

    There are many additional editing settings you can configure on the Settings tab. Although you want city staff to edit this layer, you also want the community to contribute, so you'll create multiple views instead. Hosted feature layer views allow you to publish your feature layer once and create multiple views to meet different viewing and editing requirements. The views reference the same source feature layer so you avoid duplicating data. Otherwise, if you publish multiple copies of the data with unique capabilities for each, you need to merge them periodically in ArcGIS Pro to keep them updated.

  25. Return to the Overview tab.

Next, to further enhance performance, you will create additional hosted feature layer views by using Feature Definition to only allow relevant editing capabilities and displays for each audience in your group.

Create a hosted feature layer view

You identified three audience needs for your data: public viewing; public contributing; and city staff viewing, contributing, and updating. First, you'll create a view for city staff who need to report coyote activity and see all recent reports.

  1. Under the Share button, if necessary, click the Show more button.

    Show more button

  2. Click Create view layer and click View layer.

    Create view layer button

  3. In the Create view layer window, in the Layers pane, ensure the coyotes_oakville layer is selected. Click Next.
  4. In the Included layers pane, click the coyotes_oakville layer.

    The Layer definitions pane appears.

    You can set view definitions to hide fields that you don't want users to see or show only a subset of the features in the overall dataset. You'll set a definition on the view to show only recently reported activity. For this scenario, data collected in 2018 is considered recent data.

  5. In the Layer definitions pane, click Add filter. In the Filter pane, click Add new.
  6. Use the menus to build the expression Date_of_observation is after 12/31/2017.

    Expression set to Date_of_observation is after 12/31/2017 in the Filter pane

    The map updates to show fewer features, only those with attributes that match the criteria of the view definition.

    Map of reported coyote activity that meets the defined criteria

    Someone may report a coyote sighting without providing a date. You'll edit the view definition to include blank date fields.

  7. Click Add new and build the expression Date_of_observation is blank.

    Condition for sightings without a date

    The view must include features that meet the criteria of either expression rather than the default setting to meet the criteria of both expressions.

  8. Above the two expressions, choose Any of the following are true.

    Filter results set to Any of the following are true in the Filter pane

  9. Click the Back button twice to return to the Included layers pane. Click Next.
  10. In the Create pane, for Title, type Coyotes_Oakville_Staff and add your initials. Accept the tags and summary inherited from the original hosted feature layer and click Create.

    It takes a moment to create the view and publish the layer. The page refreshes and displays the item page for the new view.

  11. On the Coyotes_Oakville_Staff item page, update the item details as follows:
    • For Description, click Edit and type City staff can use this layer to view, add, and update recently reported coyote activity in Oakville. Click Save.
    • For Terms of Use, click Edit and copy and paste This layer was created for instructional purposes using a modified version of the Coyote Encounters CSV data file downloaded from the Town of Oakville Open Data Portal (https://portal-exploreoakville.opendata.arcgis.com). Click Save.
    • On the side of the item page, for Acknowledgments, click Edit and copy and paste Contains information licensed under the Open Government License - Town of Oakville. (https://www.oakville.ca/data/open_data_licence.html). Click Save.

Configure how others can use the data

The publisher of the feature layer (or the administrator in your organization) decides whether a feature layer is editable and sets the editing capabilities. Before sharing data with the public, you want to confirm that it’s been reviewed. To support your review process, you’ll enable full editing access on the view so city staff can add features, delete duplicate and accidental submissions, and moderate reports by editing inappropriate information.

  1. On the blue ribbon, click the Settings tab.
  2. In the Feature Layer (hosted, view) section, turn on Enable editing.

    Enable editing

  3. Under Editing capabilities, ensure the following:
    • For What kind of editing is allowed, ensure that Add, Delete, and Update are turned on.
    • Under Update, ensure that Attribute and geometry is selected.
  4. At the top of the Feature Layer (hosted, view) section, click Save.

Create and configure more views

The next two views you’ll create are to inform and engage the public. One view can be added to a public awareness app to show areas with a high density of reported activity to emphasize areas with a higher risk of coyote encounters. The final view can be added to a crowdsourcing app to allow the public to report coyote sightings.

  1. On the ribbon, click the Content tab. In the content list, click the name of the coyotes_oakville feature layer.

    Feature layer name in the content list

  2. On the coyotes_oakville item page, click Create view layer and choose View layer.

    In the Create view layer window, ensure coyotes_oakville is selected and click Next.

  3. Under Included layers, click the coyotes_oakville layer.

    The Layer definitions pane appears.

    The first definition view you'll make is for public viewing. You'll hide a field that isn't relevant to the public, and only show those features that have already been reviewed by staff.

  4. In the Layer definitions pane, click Fields. Next to Review_status, click the remove button.

    Remove button for Review_status under Fields

    Next, you will prevent the public from seeing a feature before it goes through the review process.

  5. In the Layer definitions pane, click Add filter.
  6. In the Filter pane, click Add new and build the expression Review_status is Complete.

    Expression set to Review_status is Complete

  7. Click the Back button twice to return to the Included layers pane. Click Next.
  8. In the Create pane, for Title, type Coyotes_Oakville_PublicView and add your initials.
  9. Click Create.

    The Coyotes_Oakville_PublicView item page appears.

  10. For Description, click Edit and type Reported coyote activity in Oakville. Click Save.

    The last view you'll create is for the community to report coyote activity. They won't need to see any current data. They just need access to a layer to add a new feature and attributes that describe what they observed and when. For this view, you'll restrict their ability to see features for reported activity, including their own.

  11. On the ribbon, click the Content tab. Click the coyotes_oakville feature layer.

    The item page for the coyotes_oakville feature layer appears.

  12. Click Create view layer and choose View layer.
  13. In the Create view layer window, click Next.
  14. In the Included layers pane, click the coyotes_oakville layer.

    The Layer definitions pane appears.

  15. In the Layer definitions pane, click Add filter. In the Filter pane, click Add new.
  16. Build the expression Review_status is blank.

    Expression set to Review_status is blank

    On the map, all of the symbols turn gray. The filter hides all existing features.

    Map with all features filtered

  17. Click the Back button twice to return to the Included layers pane. Click Next.
  18. In the Create pane, for Title, type Coyotes_Oakville_PublicReports, followed by your initials.
  19. Click Create.

    The Coyotes_Oakville_PublicReports item page appears.

  20. For Description, click Edit and type The community can use this layer to report coyote activity in Oakville. Click Save.

    You plan to share this view layer with the public, so next, you need to configure what features editors can edit and view.

  21. On the blue ribbon, click the Settings tab.
  22. In the Feature Layer (hosted, view) section, under Editing options, turn on Enable editing. For What kind of editing is allowed, turn off Delete and Update.

    Enable editing turned on and Delete and Update turned off

  23. For What features can editors see, ensure Editors can see all features is turned on.
  24. At the top of the Feature layer (hosted, view) section, click Save.

Add layers and edit data

Now that you've created multiple views to meet different viewing and editing requirements, you’ll add them to a map. You can test how the different views will work in practice and confirm that you set them up correctly. You’ll update data by adding and deleting features, noting the latest updates in applicable views.

  1. On the ribbon, click Content.
    Note:

    When you complete this tutorial, you can delete the items created by checking their boxes in the content list and clicking Delete.

  2. For the Coyotes_Oakville_PublicReports layer, click the options button and choose Open in Map Viewer.

    Add to new map

    The map opens in Map Viewer.

    The map doesn't display any points because you configured this layer to only allow users to add features.

  3. On the Settings toolbar, click Edit.

    Edit on the Settings toolbar

    The Editor pane appears.

  4. In the Editor pane, click New Feature.

    New Feature on the Editor pane

    Your pointer changes to the symbol of the new feature. You'll add a test feature in the water, so you find it more easily later.

  5. On the map, click anywhere in the water to add a new feature. In the Create features pane, click the Type of observation menu.

    Type of observation menu

    The list you created earlier appears.

  6. Choose No value and click Create.

    Edits that you make in Map Viewer are automatically saved to the layer.

  7. On the Settings toolbar, click Edit to close the Create features pane.
  8. In the Layers pane, point to the Coyotes_Oakville_PublicReports layer and click the visibility button to turn it off.

    Visibility button

  9. Click the Add button.

    Add button

  10. Locate the Coyotes_Oakville_PublicView layer and click the Add button.

    Add button

    The map updates to show points for reported coyote activity. You don't see the new features that you added because you configured this view to only show features that have gone through the review process.

  11. Click features on the map to display pop-ups.
    Pop-up display

    The Review_status field doesn’t appear because you set a field definition for this view. You also don’t see an option to edit the layer or attributes because it’s not an editable layer.

  12. Close the pop-up and add the Coyotes_Oakville_Staff layer to the map.
  13. In the Add layer pane, click the Back button to return to the Layers pane.
  14. In the Layers pane, click the visibility button for the Coyotes_Oakville_PublicView layer to turn it off.

    The staff layer only displays recently reported activity, including the new feature you added using the public layer.

    Staff view layer

    You configured this layer with full editing capabilities, including update and delete.

  15. On the Settings toolbar, click Edit. In the Editor pane, under Edit features, click the Select by point button.

    Select by point button

  16. On the map, click the point you added in the water to select it.
  17. In the Edit feature pane, click Delete to remove the feature from the map and the dataset.
  18. In the Delete feature window, click Delete.

    You don't need to save the map because the edits you made were to the layer, not the map.

    After deleting test features, you're ready to share the public views with everyone and the staff view with your organization or applicable groups. When you share an editable layer with the organization (or a group), only members who are assigned a role with editing privileges can edit the feature layer.

    Note:

    For more information, see Share items and Data access and editing.

You have published data as a hosted feature layer and created multiple views with different editing capabilities to meet the requirements of your crowdsourcing solution. What's next?

Configure focused apps using the hosted feature layer views that you created. A few suggestions are as follows:

Complete another tutorial to learn how to create an app from a map. To find more scenario-based tutorials, browse the Esri Tutorials gallery.