Frequently asked question

What is the difference between a map service, feature service, and a hosted feature layer?

Last Published: May 11, 2022

Answer

What is a map service, feature service, and hosted feature layer?

  • A map service is a data hosting service that provides map images for display in a client application, and the images can be rendered dynamically for a specific extent or pre-rendered and cached in a tile grid as static images.
  • A feature service refers to a data hosting service that contains feature layers used to access spatial data and tables used to access non-spatial data.
  • A feature layer is a data layer that can access and display feature data with the same type of geometry (point, polyline, or polygon) and attribute fields, and a hosted feature layer is a reference to a feature layer in a feature service that is stored in ArcGIS.

What are the different functionalities between a map service and a feature service?

A feature service is a map service with feature access enabled, and when the same data is hosted as a map service and a feature service, the functionalities available to interact with the data are different as well.

A map service is the way maps are made available over the internet or the organization's intranet using ArcGIS and this can be achieved using a cached map service or a dynamic web service. A feature service exposes the geometry, attributes, and symbol information for vector features and is appropriate for displaying, querying, and editing business data on top of web basemaps.

When a map service is used as a cached map service, the map service provides a map image layer pre-symbolized at the server-side. This is the fastest way to serve maps on the web but the symbology in that cached map service cannot be changed by the client. In comparison, when a map service is used as a dynamic web service with dynamic layers enabled, the client is able to change the layer appearance and behavior of the map service when used in a web map.

In ArcGIS REST Services Directory, Supports Dynamic Layers is listed as 'true' for a map service with dynamic layers enabled.

The Supports Dynamic Layers section of the map service in the ArcGIS REST Services Directory.
Note:
Follow the workflow in ArcGIS Server: Enable dynamic layers on a map service in Manager to allow clients to change the layer appearance and behavior in a map service.

The image below shows the Change Style function is available when a map service with dynamic layers enabled is added to a web map in Map Viewer Classic, and the client is able to change the style of the layers.

The Content pane in Map Viewer Classic with the Change Style function available for the layers of a dynamic map service added to the web map.

A feature service, similar to a map service with dynamic layers enabled, also provides the functionality to dynamically customize the feature's symbology on the client's end. The difference between a map service that supports dynamic layers and a feature service is the editing capability. A map service does not expose the editing capability and provides read-only access to feature and attribute content, while a feature service contains the information from feature layers that can be edited if editing is enabled. Clients can query and edit the feature geometry and attributes of a feature service. Additionally, existing and new features can be edited and added, respectively.

The image below shows the Change Style function is available when a dynamic map service and a feature service are added to a web map. However, the Edit function is only available on the ribbon in Map Viewer Classic when a feature service is added to the web map.

The Contents pane in Map Viewer Classic with the Change Style functions available when a dynamic map service or a feature service is added to the web map. The Edit function is available on the ribbon for the web map with a feature service added.

The Edit function is only available on the Map Viewer's Settings toolbar when a feature service is added to the web map. Additionally, the Information section is also present in the Properties pane.

The Edit function is available on the Settings (light) toolbar in Map Viewer when a feature service is added to the web map. The Information section is also available in the Properties pane.

A map service is also available as a Keyhole Markup Language (KML) network link. This allows applications capable of viewing KML, such as ArcGIS Earth and Google Earth, to consume a map service. However, this operation is not supported in a feature service. A feature service can be consumed using either a web client or ArcGIS Desktop. It can also be added to Map Viewer in ArcGIS Online or a portal's website using the service's ArcGIS Server Services Directory URL. The feature service can also be added as an item in a portal or ArcGIS Online and shared with the members of the organization.

Note: 
Refer to ArcGIS Developer: Generate KML and ArcGIS Server: Viewing services as KML for more information on generating KML network links from a map service. For more information on ArcGIS clients that can be used to edit or view the features in a feature service, refer to ArcGIS Server: Feature services and client applications.

What is the difference between a feature service and a hosted feature layer?

A feature service is a type of data storing service and a hosted feature layer is spatial data published to ArcGIS Online or Portal for ArcGIS. A feature service is a map service with feature access enabled, and a hosted feature layer is a feature service in which its feature data is hosted by, or stored in, one of two different data stores configured with a portal's hosting server by the administrator.

When a hosted feature layer is created using data management tools, an item and a feature layer in the feature service are created. The item ID is a unique identifier to the layer. If the data is published to an ArcGIS Enterprise portal, the hosted feature layer data are stored in the portal's relational data store, and there is a feature service running on the portal's hosting server. If the data are published to ArcGIS Online, the hosted feature layer data are stored in ArcGIS Online.

Note:
For more information on publishing a hosted feature layer, refer to Portal for ArcGIS: Publish hosted feature layers and ArcGIS Online: Publish hosted feature layers.

A feature service running on a stand-alone or federated ArcGIS Server site can be used as a layer in a portal and the layer behaves similarly to a hosted feature layer. However, unlike a hosted feature layer, the data are not copied into the hosting server's relational data store and stays in the data source registered with the ArcGIS Server site. When the layer is deleted, the data are not deleted. This is different from a hosted feature layer where deleting the hosted feature layer deletes the service and the data as well.

These differences between a feature service and a hosted feature layer are implemented to guard against unwanted changes being made to the data stored in the folders and databases registered with the ArcGIS Server site. A feature service is likely accessed directly by other applications, whereas a hosted feature layer's data are managed through the portal and not directly accessed by other applications.

The URL format of a map service, feature service, feature layer, and hosted feature layer

  • In the ArcGIS REST API Services Directory, a map service's URL follows the format described below. The URL for a map service ends with '/MapServer'. In this example, this is the URL for the 'Recreation' map service on sampleserver6.
https://<catalog-url>/<serviceName>/MapServer
https://sampleserver6.arcgisonline.com/arcgis/rest/services/LocalGovernment/Recreation/MapServer
Note:
When a map service is added to a web map without the layer ID in the URL, the map service is added as a map image layer item. When a map service is added to a web map with the layer ID of its feature layer at the end of the URL, the map service is added as a feature layer item.
  • A feature service's URL follows the format described below. The URL ends with '/FeatureServer' to indicate the type of service. In this example, this is the URL for the 'Recreation' feature service on sampleserver6.
https://<catalog-url>/<serviceName>/FeatureServer
https://sampleserver6.arcgisonline.com/arcgis/rest/services/LocalGovernment/Recreation/FeatureServer
  • A feature layer's URL follows the format described below. The feature layer's layer ID is used instead of the feature layer's name. In this example, this is the URL for layer 0, 'Facilities' in the 'Recreation' feature service on sampleserver6.
https://<adminfeatureservice-url>/<layerId>
https://sampleserver6.arcgisonline.com/arcgis/rest/services/LocalGovernment/Recreation/FeatureServer/0
  • Layer IDs often start at 0 and form a contiguous range of 0, 1, 2, 3, 4. However, this is not guaranteed. Use the base service URL to determine the actual layer ID, or in the ArcGIS REST Services Directory, refer to the number listed in the parenthesis next to the feature layer to determine the layer IDs. In this example, the layer IDs for the feature layers, Facilities, Trails, and Recreational Area in the feature service are 0, 1, and 2, respectively.
In ArcGIS REST Services Directory, three layers are listed under the Layers section of the Recreation feature service. The layers are Facilities, Trails, and Recreational Area. The layer ID is listed in the parenthesis next to each layer.
  • To access the item details page of the hosted feature layer, use a portal search URL with the ID for the item. The item must be shared publicly to use this URL. In this example, this is the URL for the publicly shared 'Zip Codes' polygon layer.
https://www.arcgis.com/home/item.html?id=<ID>
https://www.arcgis.com/home/item.html?id=ba101d93dff24e5ca9f0c75aaab86fba

Article ID: 000027304

Software:
  • ArcGIS Online
  • Portal for ArcGIS
  • ArcGIS Server

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options