Feature (Map Service/Layer)

URL:
https://<layer-url>/<featureId>
Methods:
GET
Required Capability:
Data
Version Introduced:
10.0

Description

An individual feature resource represents a single feature in a layer in a map service. A feature resource has two child resources:

  • Attachment Infos—Returns information about attachments associated with this feature. This resource is available only if the layer has advertised that it has attachments.
  • HTML Popup—Returns information about the HTML pop-up associated with this feature.

Request parameters

ParameterDetails

returnZ

If true , z-values will be included in the results if the features have z-values. Otherwise, z-values are not returned. The default is false .

Values: true | false

returnM

If true , m-values will be included in the results if the features have m-values. Otherwise, m-values are not returned. The default is false .

Values: true | false

gdbVersion

GeoDatabase version to query. This parameter applies only if hasVersionedData property of the service and isDataVersioned property of the layer or layers queried are true . If this is not specified, the query will apply to the published map's version.

Syntax

Use dark colors for code blocksCopy
1
gdbVersion=<geodatabase version>

Example

Use dark colors for code blocksCopy
1
gdbVersion=sde.USER1

f

The response format. The default response format is html .

Values: html | json

Example usage

The following is a sample request URL used to access a feature resource:

Use dark colors for code blocksCopy
1
https://machine.domain.com/webadaptor/rest/services/Hurricanes/NOAA_Tracks_1851_2007/MapServer/0/1

JSON Response syntax

Use dark colors for code blocksCopy
1
2
3
{
  "feature": <feature>
}

JSON Response example

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
{
  "feature": {
    "attributes": {
      "OBJECTID": 1,
      "BTID": 1,
      "NAME": "NOTNAMED",
      "LAT": 28,
      "LONG": -94.8,
      "WIND_KTS": 80,
      "PRESSURE": 0,
      "CAT": "H1",
      "BASIN": "North Atlantic",
      "TRACK_DATE": -3740169600000,
      "Shape_Length": 0.600000000000023
    },
    "geometry": {
      "paths": [
        [
          [-94.7999999999999, 28.0000000000001],
          [-95.3999999999999, 28.0000000000001]
        ]
      ]
    }
  }
}

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