URI
<arcgisrest_uri>/{datasourceName}/FeatureServer[.<format>]
支持的方法
父资源
子资源
介绍
要素服务允许客户端查询和编辑几何要素、属性。此资源提供有关要素服务的基本信息,包括要素服务包含的要素图层、表、服务描述等。
支持的方法:
资源层次
HTTP 请求方法
对如下 URI 执行 HTTP 请求,以 json 输出格式为例加以说明,其中,supermapiserver 是服务器名,{component}是服务组件名,{datasourceName}是数据源名。
http://supermapiserver:8090/iserver/services/{component}/arcgisrest/{datasourceName}/FeatureServer.json
GET 请求
获取要素服务的基本信息,包括要素服务包含的要素图层、表、服务描述等。
名称 | 类型 | 含义 |
f | String | 响应格式,支持 json、pjson |
响应结构
对 featureService 资源执行 GET 请求,获取要素服务的基本信息,由以下字段组成:
字段 | 类型 | 说明 |
fullExtent | ArcGISMapExtend | 地图的全幅范围 |
capabilities | String | 支持的功能,以逗号分隔,如: Create,Delete,Query,Update,Uploads,Editing |
layers | FeatureLayerInfo[] | 图层列表 |
allowGeometryUpdates | boolean | 是否允许更新几何字段 |
maxRecordCount | long | 最大记录数 |
supportsAdvancedQueries | boolean | 是否支持高级查询 |
type | ArcGISGeometryType | 查询的类型,可为 Layer、Table |
supportedQueryFormats | String | 支持返回的查询结果的格式 |
geometryType | ArcGISGeometryType | 几何类型,几何类型可以是 esriGeometryPoint、esriGeometryMultipoint、esriGeometryPolyline、esriGeometryPolygon、esriGeometryEnvelope。默认几何类型是 esriGeometryPoint |
spatialReference | ArcGISSpatialReference | 空间参考 |
currentVersion | String | 当前版本 |
响应示例
对 ArcGIS featureService 资源:http://localhost:8090/iserver/services/data-BeijingAddress/arcgisrest/BeijingAddress/FeatureServer?f=pjson 执行 GET 请求,返回 pjson 格式的资源表述如下:
{
"fullExtent": {
"ymin": 4787401.537187391,
"xmin": 1.2848061091746317E7,
"ymax": 5024534.925299342,
"xmax": 1.3080107104713367E7,
"spatialReference": {"wkt": "PCS_NON_EARTH"}
},
"capabilities": "Create,Delete,Query,Update,Uploads,Editing",
"allowGeometryUpdates": true,
"maxRecordCount": 1000,
"layers": [
{
"extent": null,
"capabilities": null,
"allowGeometryUpdates": true,
"maxRecordCount": 1000,
"supportsAdvancedQueries": true,
"type": "Feature Layer",
"objectIdField": null,
"supportedQueryFormats": "JSON",
"name": "company",
"id": 0,
"fields": null,
"geometryType": null,
"advancedQueryCapabilities": null
},
{
"extent": null,
"capabilities": null,
"allowGeometryUpdates": true,
"maxRecordCount": 1000,
"supportsAdvancedQueries": true,
"type": "Feature Layer",
"objectIdField": null,
"supportedQueryFormats": "JSON",
"name": "hospital",
"id": 1,
"fields": null,
"geometryType": null,
"advancedQueryCapabilities": null
},
{
"extent": null,
"capabilities": null,
"allowGeometryUpdates": true,
"maxRecordCount": 1000,
"supportsAdvancedQueries": true,
"type": "Feature Layer",
"objectIdField": null,
"supportedQueryFormats": "JSON",
"name": "school",
"id": 2,
"fields": null,
"geometryType": null,
"advancedQueryCapabilities": null
},
{
"extent": null,
"capabilities": null,
"allowGeometryUpdates": true,
"maxRecordCount": 1000,
"supportsAdvancedQueries": true,
"type": "Feature Layer",
"objectIdField": null,
"supportedQueryFormats": "JSON",
"name": "county_R",
"id": 3,
"fields": null,
"geometryType": null,
"advancedQueryCapabilities": null
}
],
"spatialReference": {"wkt": "PCS_NON_EARTH"},
"currentVersion": "10.3"
}
HEAD 请求
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 featureService 资源是否存在,或者客户端是否有权限访问 featureService 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 featureService 资源是否支持<format>格式的表述。