Sometimes we need to query some data on the service according to the published arcgis service, such as clicking on a certain location on the map, such as querying elements based on a certain keyword, etc., and arcgis commonly use three apis in this regard: find , Query and identify.
One, find query
The search operation is performed on the map service resource. The result of this operation is the search result resource. Each result contains its value, feature ID, field name, layer ID, layer name, geometry, geometry type, and attributes in the form of name-value pairs.
API description : http://xxx/arcgis/sdk/rest/index.html#/Find/02ss00000085000000/
query demonstration : http://xxx/arcgis/rest/services/my_layer/MapServer/find
query conditions :
query example : http://xxx/arcgis/rest/services/my_layer/MapServer/find?searchText=%E5%90%88&contains=true&searchFields=RNAME&sr=&layers=0%2C1%2C2%2C3%2C4%2C5&layerDefs=&returnGeometry=false&maxAllowableOffset=&geometryPrecision=&dynamicLayers=&returnZ=false&returnM=false&gdbVersion=&f=pjson
query description : Fuzzy query for data with ligatures in the RNAME attribute, the result does not contain boundary data
query result :
Two, query query
The query operation is performed on the dynamic layer/table resource. The result of this operation is a feature set. This feature set contains Feature objects, including the values of fields requested by the user. For layers, if geometry information is requested, the geometry of each feature will also be returned in the feature set. For tables, the feature set does not include geometry.
When the output format f is kmz, the result will always contain the Z value, regardless of the returnZ attribute value. If the feature geometry does not support Z, the default value of 0 will be returned for Z.
API description : http://xxx/arcgis/sdk/rest/index.html#//02ss00000081000000
Query demonstration : http://xxx/arcgis/rest/services/my_layer/MapServer/93/query
其中93是具体的图层,在这个服务中表示县级行政区
query conditions :
query example : http://xxx/arcgis/rest/services/my_layer/MapServer/93/query?where=CODE=340102&f=json
query description : according to where to query the administrative region whose CODE is equal to 340102, the result contains boundary data
query results :
query example : http://xxx/arcgis/rest/services/my_layer/MapServer/85/query?f=json&where=1=1&returnGeometry=true&spatialRel=esriSpatialRelIntersects&objectIds=1&outFields=*&outSR=102100
query description : query the data with objectid 1 in the 85 layer, the result contains the boundary data
query result :
Three, identify query
Perform recognition operations on map service resources to discover features at geographic locations. The result of this operation is the recognition result resource. The result of each identification includes its name, layer ID, layer name, geometry and geometry type, and other attributes that are the result of name-value pairs.
application scenario : Click on the map to query the features or layers of the clicked location
API description :http://xxx/arcgis/sdk/rest/index.html#/Identify_Map_Service/02ss000000m7000000/
query demonstration : http://xxx/arcgis/rest/services/my_layer/MapServer/identify
query conditions :
query example : http://xxx/arcgis/rest/services/my_layer/MapServer/identify?f=json&tolerance=5&returnGeometry=false&imageDisplay=1073,897,96&geometry={%22x%22:13095597.208668906,%22y%22:3709649.674951799}&geometryType=esriGeometryPoint&sr=102100&mapExtent=12937525.434175162,3602943.583465693,13265593.159575136,3877199.640952905&layers=all:77,74,73,52
query description : query data according to latitude and longitude x, y, the coordinate system of xy is related to the layer
query result :
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。