GET /{serviceName}/MapServer/{layerId}/query

arcgis.com:arcgis-rest-api

Summary: Query Map Service Layer
Operation ID: queryMapLayer
Auth: unknown
Description

Performs a query operation on a layer or table resource of a map service. The result of this operation is a feature set.

Parameters (18)

f (string, query, optional, default: json)

Response format

Constraints: {'enum': ['json', 'html', 'geojson', 'pbf']}

geometry (string, query, optional)

The geometry to apply as the spatial filter (JSON or simple syntax)

geometryType (string, query, optional)

The type of geometry specified by the geometry parameter

Constraints: {'enum': ['esriGeometryPoint', 'esriGeometryMultipoint', 'esriGeometryPolyline', 'esriGeometryPolygon', 'esriGeometryEnvelope']}

groupByFieldsForStatistics (string, query, optional)

Field names to group statistics by

inSR (string, query, optional)

The spatial reference of the input geometry (WKID or JSON)

layerId (integer, path, required)

Layer ID

objectIds (string, query, optional)

Comma-separated object IDs to query

orderByFields (string, query, optional)

Field names to order results by

outFields (string, query, optional)

Comma-separated list of fields to include in result set (use * for all)

outStatistics (string, query, optional)

JSON array of field statistics definitions

resultOffset (integer, query, optional)

Number of records to skip

resultRecordCount (integer, query, optional)

Maximum number of records to return

returnCountOnly (boolean, query, optional, default: False)

If true, the response only includes the count of features

returnGeometry (boolean, query, optional, default: True)

If true, the result includes the geometry

returnIdsOnly (boolean, query, optional, default: False)

If true, the response only includes an array of object IDs

serviceName (string, path, required)

Name of the map service

spatialRel (string, query, optional)

The spatial relationship to be applied to the input geometry

Constraints: {'enum': ['esriSpatialRelIntersects', 'esriSpatialRelContains', 'esriSpatialRelCrosses', 'esriSpatialRelEnvelopeIntersects', 'esriSpatialRelIndexIntersects', 'esriSpatialRelOverlaps', 'esriSpatialRelTouches', 'esriSpatialRelWithin']}

where (string, query, optional)

A WHERE clause for the query filter

No probe data for this endpoint yet.