<queryResults_uri>/{resultID}[.<format>]
A queryResult resource is a map query result. It is created when implementing the POST request on the queryResults resource. The representation of the query result will be returned if a GET request if implemented on the queryResult resource (resultID).
The query result can overlay on the map resource to display(Currently, the map JavaScript formulation supports this function, which is easy to view the detailed information visually.
Supported methods
Supported output formats: RJSON, JSON, HTML, XML, GeoJSON.
Note: GeoJSON representation is available only when the type of the queried layer is point, line or region.
Implement the HTTP request on the following URI, where supermapiserver is the server name, WorldMap is the map name (mapName), and 1 is the ID of the query result after performing the query on WorldMap.
"http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/queryResults/1.json
Gets the representation of the query result resource, which can be the result from the SQL query, distance query, spatial query, closest feature query, bounds query, etc.
When implementing the GET request on the queryResult resource, parameters that can be included in the URI are as follows:
Field | Type | Definition |
realtime | boolean | Optional Whether the query result must be real time. If true, the query will be performed again and the result will be returned. If false, the result will be got from the caches. The default is false. |
_cache | boolean | [Optional parameters] Whether to use cache, the default is True. False means close all the caches. |
When implementing the GET request on the queryResult resource to get the response in image format, additional parameters that might be included in the URI are as follows:
Field | Type | Definition |
useGeoCoordSys | boolean | Whether to transform the projected coordinate system to geographic coordinate system for the convenience of adding the result to the scene. |
rectifyViewer | boolean | Whether to automatically rectify the image size in order to keep it consistent with the extent of the query result. If true, the image will be automatically rectified; otherwise, the image will be returned in the original size. |
style | Style | The style for highlighting the target in the query result. |
center | Point2D | Specified the center point for map display. |
scale | double | Specifies the scale for map display. |
viewer | Rectangle | Specifies the display window, that is, the size of the image. |
transparent | boolean | Whether the map image is transparent or not. |
viewBounds |
Rectangle2D | Specifies the output extent of the map. If not specified, the output extent will be consistent with the bounds of the query result object. |
foreColor | Color | Specifies the foreground color of the map. |
backColor | Color | Specifies the background color of the map. |
layersID | String | The ID of the temporary layer set to be output. The temporary layer set is created via the tempLayersSet resource. |
prjCoordSys | PrjCoordSys | The coordinate system (projection) of the map. Map projection, as a very important concept, is the base for geographic representation. |
cacheEnabled | boolean | Whether to use cache. |
customParams | String |
Custom parameters Can be a string with any combination of characters. Users can pass custom parameters by using this field. |
rectifyType | RectifyType | The rectification method . |
clipRegion | Geometry | The crop area. |
clipRegionEnabled | boolean | Whether it is allowed to set the clip region. |
customEntireBounds | Rectangle2D | Custom map bounds. Valid when customEntireBoundsEnabled is true. |
customEntireBoundsEnabled | boolean | Whether customEntireBounds is enabled. |
angle | double | The rotation of the current map. |
antialias | boolean | Whether to apply antialiasing to the map. |
backgroundStyle | Style | The background style of the map. |
colorMode | MapColorMode | The color mode of the map. |
markerAngleFixed | boolean | Whether the specified angle of the marker symbol is fixed. |
dynamicProjection | boolean | Whether dynamic projectioning is allowed. |
maxVisibleTextSize | double | The maximum visible size of the text, in pixels. |
maxVisibleVertex | int |
The maximum visible vertices of the geometric object. If a geometric feature has more than maxVisibleVertex vertices, the extra vertices will not be displayed. |
minVisibleTextSize | double | The minimum visible size of the text, in pixels. |
overlapDisplayed | boolean | Whether to display objects when overlapped. |
paintBackground | boolean | Whether to render the background of the map. |
textAngleFixed | boolean | Whether the angles of the text are fixed. |
textOrientationFixed | boolean | Whether the orientations of the text are fixed. |
Implement the PUT request on the queryResult resource. The structure of the response is as follows:
Name | Type | Description |
currentCount | int | The number of records returned by performing the query. |
customResponse | String | The result of the custom action. |
recordsets | Recodset[] | The query recordset. Note: The field information of the query recordset is recorded via the fields field of Recordset. The value of the fieldNames field for each Feature is null. |
totalCount | int | The total number of records of the query result. |
An image will be returned if the specified representation format is image.
Implement the GET request on the queryResult resource with http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/queryResults/1.rjson?realTime=true to get the response in rjson format, as shown below:
Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. The meta-information includes the media-type, content-encoding, transfer-encoding, content-length, etc.
Gets the metadata information about the queryResult resource. Checks the existence of the queryResult resource and whether it can be accessed by the client. By implementing the HEAD request on the URI, with .<format> appended to the end, we can quickly get to know whether the queryResult resource supports the representation in <format> or not.