Getting image cache data

Feedback


The retrieving and operation on 3D data is implemented by the datas resource and its child resources. Below is the illustration for retrieving a block of image cache data from the server.

Implement the GET request on http://localhost:8090/iserver/services/components-rest/rest/realspace/datas/beijing@beijing.rjson to get the representation of the 3D data beijing@beijing, if exists, as shown below:

{

    "dataName": "beijing@beijing",

    "dataType": "IMG"

}

Therefore, we know that beijing@beijing is image data.

Implement the GET request on the config child resource of the image data resource beijing@beijing to get the configuration file of the image data. Save the file and open it. From the node <sml:Levels/>, we know that there are 15 levels of image caches.

<sml:Levels>

        <sml:Level>8</sml:Level>

        <sml:Level>9</sml:Level>

        <sml:Level>10</sml:Level>

        <sml:Level>11</sml:Level>

        <sml:Level>12</sml:Level>

        <sml:Level>13</sml:Level>

        <sml:Level>14</sml:Level>

        <sml:Level>15</sml:Level>

</sml:Levels>

Here we take retrieving the tile in PNG at (9103,53956) on level 15 as an example. Construct the URI as shown below by referring to URI1 of the tiledata resource http://<server>:<port>/services/rest/realspace/datas/dataName/data/index/xIndex/yIndex.fileExtent.

http://localhost:8090/iserver/services/components-rest/rest/realspace/datas/beijing@beijing/data/index/9103/53956.png?level=15

Implement the GET request on the URI to get the tile at (9103, 53956) on level 15, as shown below:

SuperMap iServer supports to get the image cache data of the specific scene and layer by adding sceneName and layerName to URI of tiledata. The URI is:

http://localhost:8090/iserver/services/components-rest/rest/realspace/datas/beijing@beijing/data/index/9103/53956.png?level=15&sceneName=scene&layerName=beijing@beijing

Note: The origin for image tiling is (-180 degrees, 90 degrees), and both the row number and column number start at 0. layer 0 is divided into tiles 180 degrees of latitude by 180 degrees of longitude and the layer is cut into two tiles. 1 is divided into tiles 90 degrees of latitude by 90 degrees of longitude and the layer is cut into into 8 tiles. Presumably, each time the layer number is increased by 1, the layer will be divided with squares at 1/4 its former size.

Therefore, on the left of the tile (9103, 53956) on level 15 is the tile (9103, 53955), and below is the tile (9104, 53956). Implement the GET request on each of them to display the tiles. Add the tags below on the HTML page.

<BODY>

        <IMG id =map BORDER=0cm src=http://localhost:8090/iserver/services/components-rest/rest/realspace/datas/beijing@beijing/data/index/9103/53955.png?level=15>

        <IMG id =map BORDER=0cm src=http://localhost:8090/iserver/services/components-rest/rest/realspace/datas/beijing@beijing/data/index/9103/53956.png?level=15>

        <br>

        <IMG id =map BORDER=0cm src=http://localhost:8090/iserver/services/components-rest/rest/realspace/datas/beijing@beijing/data/index/9104/53955.png?level=15>

        <IMG id =map BORDER=0cm src=http://localhost:8090/iserver/services/components-rest/rest/realspace/datas/beijing@beijing/data/index/9104/53956.png?level=15>

</BODY>

The result is as shown below: