Step 1: Download The crossdomain. xml file
Download the crossdomain. xml file from the ArcGIS Server root directory
Step 2: Get the metadata description of FeatrueLayer
Request address: http: // 58.211.230.93: 8399/arcgis/rest/services/ChinaRoad/MapServer/0
Request Parameter :? F = json
Return Json text:
{"Id": 0, "name": "roa_4m", "type": "Feature Layer", "geometryType": "esriGeometryPolyline", "description ":"", "definitionExpression": "", "copyrightText": "", "minScale": 0.0, "maxScale": 0.0, "extent": {"xmin": 80.3868560791016, "ymin": 18.2823352813721, "xmax": 132.514663696289, "ymax": 49.6271781921387, "spatialReference": {"wkid": 4326 }}, "displayField": "FNODE _", "fields": [{"name": "FID", "type": "esriFieldTypeOID", "alias": "FID" },{ "name": "Shape ", "type": "esriFieldTypeGeometry", "alias": "Shape" },{ "name": "FNODE _", "type": "esriFieldTypeDouble", "alias ": "FNODE _" },{ "name": "TNODE _", "type": "esriFieldTypeDouble", "alias": "TNODE _" },{ "name ": "LPOLY _", "type": "esriFieldTypeDouble", "alias": "LPOLY _" },{ "name": "RPOLY _", "type ": "esriFieldTypeDouble", "alias": "RPOLY _" },{ "name": "LENGTH", "type": "esriFieldTypeDouble", "alias": "LENGTH "}, {"name": "ROA_4M _", "type": "esriFieldTypeDouble", "alias": "ROA_4M _" },{ "name": "ROA_4M_ID ", "type": "esriFieldTypeDouble", "alias": "ROA_4M_ID" },{ "name": "GBCODE", "type": "esriFieldTypeInteger", "alias ": "GBCODE"}], "parentLayer": {"id":-1, "name": "-1"}, "subLayers": []}
Step 3: first request data, construct a data request based on metadata
Http: // 58.211.230.93: 8399/arcgis/rest/services/ChinaRoad/MapServer/0/Query
| F |
Json |
| GeometryType |
EsriGeometryEnvelope |
| OutFields |
* |
| OutSR |
102100 |
| ReturnGeometry |
True |
| InSR |
102100 |
| Geometry |
{"Xmin":-50093770.85695993, "ymin":-25046885.428479966, "xmax": 50093770.85695993, "ymax": 25046885.428479966} |
| SpatialRel |
EsriSpatialRelIntersects |
Returned data:
JSON
DisplayFieldName = FNODE _
Features
{}
Attributes
FID = 0
FNODE _ = 2
Gbcode= 42220
Geometry
Paths
[]
[]
13097189.2402
6359951.5843
[]
13097189.2402
6359951.5843
[]
13097189.2402
6359951.5843
[]
13097189.2402
6359951.5843
[]
13097189.2402
6359951.5843
FieldAliases
FID = FID
FNODE _ = FNODE _
LPOLY _ = LPOLY _
RPOLY _ = RPOLY _
GeometryType = esriGeometryPolyline
SpatialReference
Wkid = 102100
Step 4: Construct a data request based on metadata and the first response
Http: // 58.211.230.93: 8399/arcgis/rest/services/ChinaRoad/MapServer/0/query
| F |
Json |
| GeometryType |
EsriGeometryEnvelope |
| OutFields |
* |
| Where |
Fid not in (, 33, 33, california, 100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150) |
| OutSR |
102100 |
| ReturnGeometry |
True |
| InSR |
102100 |
| Geometry |
{"Xmin": 7983433.333824925, "ymin":-359488.2492525261, "xmax": 20506876.048064873, "ymax": 5902233.107867448} |
| SpatialRel |
EsriSpatialRelIntersects |