Import data as a feature layer

Learn how to create hosted feature layers and feature services for your data.

You can use the developer dashboard and ArcGIS Online to import and store data in the cloud as hosted layers. If your data contains geometries with attributes, such as a CSV or GeoJSON file, it is imported as a hosted feature layer. A hosted feature layer is also referred to as a feature layer. A feature layer is used to store point, line, or polygon geometries with attributes. After a feature layer is created, applications can access it by ID or URL and then query, edit, and display features.

In this tutorial, you use data management tools to import Trailheads (CSV), Trails (GeoJSON), and Parks and Open Space (Shapefile) files and publish them as feature layers. These layers are used in other tutorials.

Prerequisites

You need an ArcGIS Developer or ArcGIS Online account to access and manage hosted layers.

Steps

Download the data

  1. Download the LA_Hub_Datsets zip file from ArcGIS Online. The zip file contains the following:

    • Trailheads.csv
    • Trails.geojson
    • Parks_and_Open_Space.zip (Shapefile)
  2. Navigate to and unzip the file.

  3. Sign in to your ArcGIS account

Import the Trailheads CSV file

The Trailheads CSV file contains point data with attributes. Importing the file will create a new point feature layer in a feature service. The import tool attempts to match field names and data types in the CSV file. The four supported field types are: String, Integer, Double, and Date.

  1. Go to your developer dashboard.

  2. At the top, click Layers > Import data.

  3. Click Import data. Upload the Trailheads.csv file by either:

    • Dragging and dropping box the file on the Drop a file here area.
    • Or, clicking the Select file button to browse to the file.
    • Click Upload file.
  4. Once the file is uploaded, set the following details in the Item Details pane:

    • Title: Trailheads
    • Tags: LA Trailheads The Tags property cannot be left blank.
    • Description: Trailheads in Mahou Riviera
  5. At the bottom, click Create layer to create the new Trailheads feature layer and feature service.

  6. In the item page, click the Settings tab.

  7. Under Layer access (Sharing), ensure that People with access is set to Public (authentication not required).

Find the Trailheads ID and URL

To access a hosted feature layer from an application, you need to be able to identify its ID and URL. If a hosted feature layer is public, you can access it directly with your web browser or any application with the URL. If the layer is private, you need to provide an API key or token. For example:

Public: https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads/FeatureServer/0

Private: https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads/FeatureServer/0?token=ACCESS_TOKEN

  1. In the Overview, find the Layer ID and Service URL. It should look something like this:
    • Layer ID: 883cedb8c9fe4524b64d47666ed234a7
    • Service URL: https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads/FeatureServer/

Import the Trails GeoJSON file

The Trails GeoJSON file contains line (polyline) data with attributes. Importing the file will create a new line feature layer in a feature service.

  1. At the top of the page, click Layers > Import data to upload your next file.

  2. Upload the Trails.geojson file by either:

    • Dragging and dropping box the file on the Drop a file here area.
    • Or, clicking the Select file button to browse to the file.
    • Click Upload file.
  3. Once the file is uploaded, set the following details in the Item Details pane:

    • Title: Trails
    • Tags: LA Trails The Tags property cannot be left blank.
    • Description: Trails in Mahou Riviera.
  4. At the bottom, click Create layer to create the new Trails feature layer and feature service.

  5. In the item page, click the Settings tab.

  6. Under Layer access (Sharing), ensure that People with access is set to Public (authentication not required).

Find the Trails ID and URL

To access a hosted feature layer from an application, you need to be able to identify its ID and URL.

  1. In the Overview, find the Layer ID and Service URL. It should look something like this:
    • Layer ID: 69e12682738e467eb509d8b54dc73cbd
    • Service URL: https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trails/FeatureServer

Import the Parks and Open Spaces Shapefile

The Parks and Open Spaces Shapefile contains polygon data with attributes. Importing the file will create a new polygon feature layer in a feature service.

  1. Click Layers > Import data to upload your next file.

  2. Upload the Parks and Open Space.zip file by either:

    • Dragging and dropping box the file on the Drop a file here area.
    • Or, clicking the Select file button to browse to the file.
    • Click Shapefile > Upload file.
  3. Once the file is uploaded, set the following details in the Item Details pane:

    • Title: Parks and Open Space
    • Tags: LA Parks The Tags property cannot be left blank.
    • Description: Parks and open spaces in Mahou Riviera.
  4. At the bottom, click Create layer to create the new Parks and Open Space feature layer and feature service.

  5. In the item page, click the Settings tab.

  6. Under Layer access (Sharing), ensure that People with access is set to Public (authentication not required).

Find the Parks and Open Spaces ID and URL

To access a hosted feature layer from an application, you need to be able to identify its ID and URL.

  1. In the Overview, find the Layer ID and Service URL. It should look something like this:
    • Layer ID: f2ea5d874dad427294641d2d45097c0e
    • Service URL: https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Parks_and_Open_Space/FeatureServer

Now you have three hosted feature layers in ArcGIS Online. You can access each hosted layer with their URL or layer ID in your applications. To manage your hosted layer properties and capabilities, visit the Manage a feature layer tutorial.

What's next?

Learn how to use additional tools, APIs, and location services in these tutorials:

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.