<dataset_uri>/gridValues[.<format>]
Perform a GET request on gridValues resource, you can query the grid cell info with a specified geographic extent, including grid value, row, column, etc. Perform a POST request, you can query the grid info by passing in multiple geographic extent.
Supported Methods:
Supported output formats: RJSON, JSON, HTML, XML.
Perform an HTTP request with the following URI, here we take rjson as the output format to demonstrate, where supermapiserver is the server name.
http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/World/datasets/LandCover/gridValues.rjson
Gets the grid cell info within a specified geographic extent.
Note: The maximum number of queries supported by iServer is 500,000. If the number of rasters in the target range exceeds 500,000, the system will report an error.
To perform a GET request on gridvalues resource to get grid infos, put the following parameter in URL:
Name | Type | Description |
bounds | String |
The geographic extent. Rectangle, polygon, round extent are supported. Such as: 1.Rectangle: {"leftBottom":{"x":112.351881,"y":34.663401},"rightTop":{"x":113.361881,"y":35.673401}} 2. Polygon, needs to specify not less than three sides: {"points": [{"x": 107.669629,"y": 32.888868},{"x": 108.012838,"y": 33.594138}, { "x": 108.674593, "y": 33.281041},{ "x": 107.669629,"y": 32.888868}]} 3. Circle, need to specify the center point and its radius: "circle":{"centerPoint":{"x":112.351881,"y":35.673401},"radius": 1}} |
After performing a GET request on gridValues resource, the returned response body structure sees as follows:
Field | Type | Description |
columnCount | int | The column number of grids in target extent. |
rowCount | int | The row number of grids in target extent. |
values | GridValue[][] | Information of all the grids in target extent. Including grid row/column number, value. For details, see: gridValue. |
valuesCount | int | The grid number included in target extent. |
Execute a GET request on gridValues resource with URL: http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/World/datasets/LandCover/gridValues.rjson?bounds={"leftBottom":{"x":112.351881,"y":34.663401},"rightTop":{"x":112.461881,"y":34.773401}} to get the grid cell infos, the response in rjson format is as follows:
{
"columnCount": 3,
"rowCount": 3,
"values": [
[
{
"column": 4677,
"row": 885,
"value": 11
},
{
"column": 4678,
"row": 885,
"value": 11
},
{
"column": 4679,
"row": 885,
"value": 11
}
],
[
{
"column": 4677,
"row": 884,
"value": 11
},
{
"column": 4678,
"row": 884,
"value": 11
},
{
"column": 4679,
"row": 884,
"value": 11
}
],
[
{
"column": 4677,
"row": 883,
"value": 11
},
{
"column": 4678,
"row": 883,
"value": 11
},
{
"column": 4679,
"row": 883,
"value": 11
}
]
],
"valuesCount": 9
}
Queries the grid info by passing in multiple geographic extent.
To get grid infos by performing a POST request on gridValues resource, the following parameters should be contained in the request entity:
Field | Type | Description |
leftBottom |
JsonObject |
Used when inputting a rectangle, which specifies the left and bottom of the input rectangle. |
rightTop |
JsonObject |
Used when inputting a rectangle, which specifies the right and top of the input rectangle. |
points | jsonArray | Used when inputting a polygon, which specifies the position of points of the polygon. |
circle |
JsonObject |
Used when inputting a circle. |
centerPoint |
JsonObject |
Used to specify the central point of the input circle. |
radius | int | Used to specify the radius of the input circle. |
point | jsonObject | Used when inputting a point. Specifies the x and y coordinate of the input point. |
The structure of the response entity is as follows:
Field | Type | Description |
columnCount | int | The column number of grids in target extent. |
rowCount | int | The row number of grids in target extent. |
values | GridValue[][] |
Information of all the grids in target extent. Including grid row/column number, value. For details, see: gridValue. |
valuesCount | int | The grid number included in target extent. |
Execute a POST request on gridValues resource with URI: http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/World/datasets/LandCover/gridValues.rjson and the following request body which specifies the registered dataset name:
[
{
"leftBottom": {
"x": 11.8504725147077,
"y": -37.1891792186755
},
"rightTop": {
"x": 12.0051569150709,
"y": -37.1065254101062
}
},
{
"circle": {
"centerPoint": {
"x": 112.351881,
"y": 35.673401
},
"radius": 0.1
}
}
]
then the returned representation in rjson format is as follows:
[
{
"valuesCount": 2,
"values": [
[],
[
{
"column": 3070,
"row": 2034,
"value": 0,
"centerPoint": {
"x": 11.90625,
"y": -37.15625
}
},
{
"column": 3071,
"row": 2034,
"value": 0,
"centerPoint": {
"x": 11.96875,
"y": -37.15625
}
}
],
[]
],
"rowCount": 3,
"columnCount": 4
},
{
"valuesCount": 8,
"values": [
[],
[
{
"column": 4676,
"row": 868,
"value": 10,
"centerPoint": {
"x": 112.28125,
"y": 35.71875
}
},
{
"column": 4677,
"row": 868,
"value": 10,
"centerPoint": {
"x": 112.34375,
"y": 35.71875
}
},
{
"column": 4678,
"row": 868,
"value": 10,
"centerPoint": {
"x": 112.40625,
"y": 35.71875
}
}
],
[
{
"column": 4676,
"row": 869,
"value": 10,
"centerPoint": {
"x": 112.28125,
"y": 35.65625
}
},
{
"column": 4677,
"row": 869,
"value": 10,
"centerPoint": {
"x": 112.34375,
"y": 35.65625
}
},
{
"column": 4678,
"row": 869,
"value": 10,
"centerPoint": {
"x": 112.40625,
"y": 35.65625
}
}
],
[
{
"column": 4677,
"row": 870,
"value": 10,
"centerPoint": {
"x": 112.34375,
"y": 35.59375
}
},
{
"column": 4678,
"row": 870,
"value": 10,
"centerPoint": {
"x": 112.40625,
"y": 35.59375
}
}
]
],
"rowCount": 4,
"columnCount": 4
}
]
Returns the same HTTP response header as the GET request, but no response entity, which can be used to retrieve the meta data contained in response message header without having to transmit the entire response content. Meta data information includes media type, character coding, compression coding, entity content length, etc.
HEAD request is used to determine whether the gridValues resource exists, or if the client has the authority to access it. By executing an HEAD request with a .<format> URI, you can quickly determine whether the gridValues resource supports the <format> representation.