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, ArcGIS Online or scripting APIs 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 and scripting APIs 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
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)
Navigate to and unzip the file.
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.
Go to your developer dashboard.
Click Layers to go to the Layers tab.
Click Import data. To upload the Trailheads.csv, either:
- Drag and drop the file into the Drop a file here area.
- Or, click Select file and navigate to the file path.
- Click Upload file.
In the Define geometry and Column data types panes, leave all settings at their defaults. Click Next to go to the Item Details pane.
Set the following details in the Item Details pane:
- Title:
Trailheads
- Tags:
Los Angeles
Trailheads
. - Description:
Trailheads in the Santa Monica Mountains.
- Title:
At the bottom, click Create layer to create the new Trailheads feature layer and feature service.
In the item page, click the Settings tab.
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 use the URL to access it directly with your web browser or any application. If the layer is private, you need to provide an access token. For example:
Public: https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads/FeatureServer/0
- In the item page of the layer, find the Item ID and Point Layer URL. They should look something like this:
- Layer ID: 883cedb8c9fe4524b64d47666ed234a7
- Point Layer URL:
https:
//services3.arcgis.com/GVgb Jbqm8h XASVYi/arcgis/rest/services/Trailheads/Feature Server/
Go to ArcGIS Online and sign in.
In the top navigation bar, click Content.
Click New item. To upload the Trailheads.csv file, you can either:
- Drag and drop the file.
- Or, click Your device and navigate to the file path.
Select Add Trailheads.csv and create a hosted feature layer to publish the file as a hosted feature layer.
In Fields, leave all fields at their default settings and click Next.
In Location settings, leave the default settings and click Next.
Set the following information in the item details pane:
- Title:
Trailheads
- Tags:
Los Angeles
Trailheads
. - Summary:
Trailheads in the Santa Monica Mountains.
- Title:
Click Next to create the new Trailheads feature layer and feature service.
In the item page, click Share > Everyone (public) > Save.
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 use the URL to access it directly with your web browser or any application. If the layer is private, you need to provide an access token. For example:
Public: https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads/FeatureServer/0
In the item page, scroll down to the bottom of the page to find the Service URL. For example:
- Service URL:
https:
//services3.arcgis.com/GVgb Jbqm8h XASVYi/arcgis/rest/services/Trailheads/Feature Server/
- Service URL:
Click View to access the feature service. Locate the Service ItemId, which will look something like this:
- Service ItemID: 883cedb8c9fe4524b64d47666ed234a7
- Import libraries.
- Provide authentication.
- Create portal item.
- Execute the publish operation.
- Handle results.
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.
In the developer dashboard, click Layers > Import data to upload your next file.
Upload the Trails.geojson file. Either:
- Drag and drop the file into the Drop a file here area.
- Or, click Select file to browse to the file path.
- Click Upload file.
In the Item Details pane, set the following values:
- Title:
Trails
- Tags:
Los Angeles
Trails
. - Description:
Trails in the Santa Monica Mountains.
- Title:
At the bottom, click Create layer to create the new Trails feature layer and feature service.
In the item page, click the Settings tab.
Under Layer access (Sharing), set People with access 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 ID and URL.
- In the Overview, find the Layer ID and Line Layer URL. It should look something like this:
- Layer ID: 69e12682738e467eb509d8b54dc73cbd
- Line Layer URL:
https:
//services3.arcgis.com/GVgb Jbqm8h XASVYi/arcgis/rest/services/Trails/Feature Server
In ArcGIS Online click Content > New item to upload your next file.
Upload the Trails.geojson file. Either:
- Drag and drop the file into the Drag and drop your file area.
- Or, click Your device and navigate to the file path.
Select Add Trails.geojson and create a hosted feature layer to publish the file as a hosted feature layer.
Set the following information in the item details pane:
- Title:
Trails
- Tags:
Los Angeles
Trails
. - Summary:
Trails in the Santa Monica Mountains.
- Title:
Click Next to create the new Trails feature layer and feature service.
In the item page, click Share > Everyone (public) > Save.
Find the Trails ID and URL
To access a hosted feature layer from an application, you need to be able to identify ID and URL.
In the item page, scroll down to the bottom of the page to find the Service URL. For example:
- Service URL:
https:
//services3.arcgis.com/GVgb Jbqm8h XASVYi/arcgis/rest/services/Trails/Feature Server
- Service URL:
Click View to access the feature service. Locate the Service ItemId, which will look something like this:
- Service ItemID: 69e12682738e467eb509d8b54dc73cbd
- Import libraries.
- Provide authentication.
- Create portal item.
- Execute the publish operation.
- Handle results.
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.
In the developer dashboard, click Layers > Import data to upload your next file.
Upload the Parks and Open Space.zip file. Either:
- Drag and drop the file into the Drop a file here area.
- Or, click Select file to browse to the file path.
- Select Shapefile.
- Click Upload file.
Set the following details in the Item Details pane:
- Title:
Parks and Open Space
- Tags:
Los Angeles
Parks
. - Description:
Parks and open spaces in the Santa Monica Mountains.
- Title:
At the bottom, click Create layer to create the new Parks and Open Space feature layer and feature service.
In the item page, click the Settings tab.
Under Layer access (Sharing), set People with access 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.
- In the Overview, find the Layer ID and Polygon Layer URL. It should look something like this:
- Layer ID: f2ea5d874dad427294641d2d45097c0e
- Polygon Layer URL:
https:
//services3.arcgis.com/GVgb Jbqm8h XASVYi/arcgis/rest/services/Parks_ and_ Open_ Space/Feature Server
In ArcGIS Online click Content > New item to upload your next file.
Upload the Parks and Open Space.zip file. Either:
- Drag and drop the file into the Drag and drop your file area.
- Or, click Your device to browse to the file path.
Set the file type to Shapefile. Select Add Parks_and_Open_Space.zip and create a hosted feature layer to publish the file as a hosted feature layer.
Set the following information in the item details pane:
- Title:
Parks and Open Space
- Tags:
Los Angeles
Parks
. - Summary:
Parks and open spaces in the Santa Monica Mountains.
- Title:
Click Next to create the new Parks and Open Space feature layer and feature service.
In the item page, click Share > Everyone (public) > Save.
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 ID and URL.
In the item page, scroll down to the bottom of the page to find the Service URL. For example:
- Service URL:
https:
//services3.arcgis.com/GVgb Jbqm8h XASVYi/arcgis/rest/services/Parks_ and_ Open_ Space/Feature Server
- Service URL:
Click View to access the feature service. Locate the Service ItemId, which will look something like this:
- Service ItemID: f2ea5d874dad427294641d2d45097c0e
- Import libraries.
- Provide authentication.
- Create portal item.
- Execute the publish operation.
- Handle results.
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:

Create a new feature layer
Use data management tools to create a new hosted feature layer.

Access feature layer data
Use ArcGIS Online tools to access and display feature layer data.

Manage a feature layer
Set the properties and capabilities of a hosted feature layer.

Publish a vector tile layer
Use ArcGIS Online to publish a vector tile layer.

Add a feature layer
Access and display point, line, and polygon features from a feature service

Add a vector tile layer
Access and display a vector tile layer in a map.

Add an image tile layer
Access and display an image tile layer in a map.

Style a feature layer
Use symbols and renderers to style feature layers.

Query a feature layer (spatial)
Execute a spatial query to get features from a feature layer.

Query a feature layer (SQL)
Execute a SQL query to access polygon features from a feature layer.

Edit feature data
Add, update, and delete features in a feature service.

Display a popup
Format a popup to show attributes in a feature layer.