How to host and manage data

1. Create a hosted layer

You can use tools, such as ArcGIS Online and the developer dashboard, or the portal service to create a hosted layer.

Data hosting

There are three ways to create a new layer:

  1. Import: Upload file(s) with your existing data to create a hosted feature layer.
  2. Create: Define a new empty hosted feature layer.
  3. Convert: Create a new type of hosted layer (data) from an existing hosted feature layer.

To import your data, you can use either of the following tools:

  1. Go to ArcGIS Online > Content > Add item.
  2. Go to ArcGIS for Developers > Dashboard > Layers > Import data.

When a file is imported, a new hosted feature layer is created with the following:

  1. Item: Feature layer (hosted) or Table (hosted)
  2. Layer and data service: Feature layer or table in a Feature service.

If the source file contains coordinate, geometry, or address information, a feature layer is created. If the source file does not contain coordinate information, a table and a layer are created.

You can upload file types such as CSV, XLS, GeoJSON, Shapefile, and File Geodatabase files. To see a full list, visit Supported types.

Tools, data, and services

Use the developer dashboard or ArcGIS Online to import the following file types.

Input file typeInput data formatOutput item typeOutput layer and data serviceUse case
CSV or XLS(X) file Google sheetsCoordinate fields e.g. x, y, latitude, longitude Address field(s) Attribute fieldsFeature layer (hosted)Feature layer (Feature service)Access and display features, SQL and spatial queries, Edit features, Sync, Extract, Offline
CSV or XLS(X) file Google sheetsAttribute fieldsTable (hosted)Table (Feature Service)Access features, SQL Query, Update, Sync, Extract, Offline
GeoJSON file*Geometry (points, lines, and polygons) AttributesFeature layer (hosted)Feature layer (Feature service)Display features, SQL and spatial queries, Edit features, Sync, Extract, Offline
Shapefile (zipped)Geometry (points, lines, or polygons) AttributesFeature layer (hosted)Feature layer (Feature service)Display features, SQL and spatial queries, Edit features, Sync, Extract, Offline
File Geodatabase (zipped)*Geometry (points, lines, or polygons) and Attributes AttributesFeature layer (hosted) Table (hosted)Feature layer (hosted) (Feature service)Display features, SQL and spatial queries, Edit features, Sync, Extract, Offline

*If a file contains multiple geometry types, a separate layer is created for each type. Feature layers support only one geometry type per layer.

2. Manage layer settings

Data hosting

Manage hosted layers and data services with data management tools.

ArcGIS Online and the developer dashboard contain content management tools to manage hosted layers and data services. These tools allow you to manage hosted layers through item pages. You use item pages to set hosted layer properties, set data service capabilities, and perform other maintenance operations such as caching, data uploading, exporting, and publishing.

With an item page, you can:

  • Set the item name, description, and tags.
  • Set sharing properties.
  • View data.
  • Build indexes and caches.
  • Optimize drawing and visibility levels.
  • Set visualization properties.
  • Set editing and edit tracking properties (hosted feature layer).
  • Upload and replace data (hosted feature layer).
  • Create views (hosted feature layer).
  • Export data (hosted feature layer).
  • Set offline capabilities.
  • Publish new layers.

Hosted layer item page

You use an item page to manage and update the properties and capabilities of your hosted layers. The available (visible) settings depend upon the type of hosted layer the item page represents, and also whether it is the owner or another user viewing the item page. Only the owner of an item can change its settings through the item page. If an item is private, it is only accessible to the owner; if it is public, others can search for and find those items on ArcGIS Online.

The following is a list of the primary settings available in an item page for most hosted layers:

  • Name: The name of the hosted layer.
  • Description: Text that describes the layer, what data it contains, and what it is used for.
  • Type: The type of hosted layer. e.g. Feature layer or Tile layer
  • Layers: Access to other layers if present.
  • Terms of use: Description of usage restrictions for accessing data.
  • Tags: Search text used to find item in ArcGIS Online.
  • *Owner: Name of the owner or publisher of the data.
  • *Source: The type of data service.
  • *URL: The URL used to access the layer in the data service.
  • *ID: The unique identifier for the hosted layer.

*Read-only properties that are assigned when the hosted layers are created.

Sharing your layer

The most common property to set in an item page for a hosted layer is the sharing property. When a hosted layer is created, the Sharing property (privacy setting) is set to Owner.

The following is a list of available sharing options:

  • Owner: Only the owner has access.
  • Organization: All members of your organization can access.
  • Everyone (public): Anyone can view and access.

To set the sharing property, use the Share button on your item page. If you make your layer private, you will need an access token to access it. To learn more about scoping API keys and OAuth 2.0, go to Security and Authentication.

3. Get layer data

To access hosted layer data, you can use tools such as ArcGIS Online and Map Viewer. You can also access the data programmatically by accessing the data service directly.

Data hosting

Item ID

If you know the item ID for your hosted layer, you find the layer and then query the service to get data.

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS API for PythonArcGIS REST JS
Use dark colors for code blocksCopy
                                           
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

// Get query layer and set up query
const parcelLayer = new FeatureLayer({
  portalItem: {
    id: "a6fdf2ee0e454393a53ba32b9838b303", // Feature layer item ID
  },
});

function queryFeatureLayer(extent) {
  const parcelQuery = {
    where: "UseType = 'Residential'",
    resultRecordCount: 1,
  };

  parcelLayer
    .queryFeatures(parcelQuery)

    .then((results) => {
      console.log("Feature count: " + results.features.length);
    })
    .catch((error) => {
      console.log(error.error);
    });
};

Layer URL

If you know the feature service URL and index for your hosted layer, you can access the layer directly and then query the service for data.

To access feature layer data, you execute a query to request a subset of the features from the feature layer. To learn more, go to Hosted feature layers.

Public

Use dark colors for code blocksCopy
 
1
https://<HOST>/<UNIQUE_ID>/ArcGIS/rest/services/<SERVICE_NAME>/<LAYER_ID>/query?where=1=1&outFields=*&f=geojson

Private

Use dark colors for code blocksCopy
 
1
https://<HOST>/<UNIQUE_ID>/ArcGIS/rest/services/<SERVICE_NAME>/<LAYER_ID>/query?where=1=1&outFields=*&f=geojson&token=<ACCESS_TOKEN>

Example

Tutorials

Tools
APIs

Services

Feature service

Add, update, delete, and query feature data.


Vector tile service

Store and access vector tile data.


Image tile service

Store and access image tile data.

API support

Full supportPartial supportNo support
  • 1. Access portal via HTTP request and authentication.
  • 2. Access via ArcGIS REST JS.
  • 3. Requires manual application of renderers

Tools

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