<tileService_uri>/jobs[.<format>]
分布式缓存的入口资源,支持创建新的切图任务。
支持的方法:
支持的表述格式:rjson、json、html、xml。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiserver 是服务器名。
http://supermapiserver:8090/iserver/manager/tileservice/jobs.rjson
获取切图任务列表。
返回切图任务列表,包括每个切图任务的信息。 单个切图任务的主要信息有:
字段 | 类型 | 说明 |
id | String | 切图任务 ID。 |
state | JobState | 切图任务当前的工作状态。 |
info | JobInfo | 切图任务的基本信息。 |
对 tileJobs 资源:http://localhost:8090/iserver/manager/tileservice/jobs.rjson 执行 GET 请求,返回切图任务列表,rjson 格式的响应结果如下:
创建新的切图任务。
请求体参数结构如下:
名称 | 类型 | 含义 |
dataConnectionString | String | 待切图数据的连接信息,支持直接传入服务组件名,如"map-china400"。 |
mapName | String | 待切图的地图名称。 |
tileSize | TileSize | 缓存图片大小,默认为“SIZE_256”。 |
format | OutputFormat | 缓存图片格式,如“PNG”。 |
transparent | boolean | 图片是否透明,默认为 false。 |
scaleDenominators | double[] | 切图比例尺分母集合,如 ["1000000", "2000000"]。 |
originalPoint | Point2D | 切图索引的起始,计算瓦片行列号的起始坐标点,默认为地图左上角。 |
epsgCode | int | 切图的坐标系,不指定时默认使用原地图的坐标系。 |
cacheBounds | Rectangle2D | 缓存切图范围,如[0,0,180,90],可以不指定,默认为地图全幅范围。 |
storageID | String | 存储配置的 ID。 |
storeConfig | TileSourceInfo | 瓦片存储配置。 |
createNewTileVersion | boolean | 是否新建切片版本。 |
parentTileVersion | String | 待新建切片版本的父版本,null 表示基于最后一个更新版本进行新建版本。 |
tileType | tileType | 切片类型。 |
utfGridParameter | UTFGridJobParameter | 属性切片配置参数。当切片类型为 UTFGrid 时,该参数才生效。 |
vectorParameter | VectorJobParameter | 矢量切片配置参数。当切片类型为 Vector 时,该参数才生效。 |
字段 | 类型 | 说明 |
succeed | String | 切图是否成功。 |
newResourceID | String | 创建的切图任务资源的 ID。 |
customResult | TileJob | 创建的切图任务资源的相关信息。 |
newResourceLocation | String | 创建的切图任务资源地址。 |
postResultType | enum | POST 请求的结果类型。"CreateChild"类型指的是创建子资源。 |
创建一个新的切图任务,即对 http://localhost:8090/iserver/manager/tileservice/jobs.rjson 执行 POST 请求,rjson 格式请求体如下
{
"dataConnectionString": "map-china400",
"mapName": "China",
"tileSize": "SIZE_256",
"format": "PNG",
"transparent": false,
"scaleDenominators": ["1200000"],
"cacheBounds": {
"left": "-20037508.342789244",
"bottom": "-20037508.34278914",
"right": "20037508.342789244",
"top": "20037508.342789095"
},
"storageID": "aa",
"storeConfig": {
"fdhtGroups": [
["192.168.122.44:11411"]
],
"type": "FastDFS",
"fdfsTrackers": ["192.168.122.44:22122"]
},
"originalPoint": null,
"epsgCode": -1,
"tileType":"Image"
}
则返回的 rjson 格式响应结果如下:
{
"customResult": {
"id": "c9575f3c-c417-4ef9-a4da-9b0aa2c68d32",
"info": {
"actualTileVersion": "119df1b3-03f8-46de-b194-4f4e0473c9d8",
"cacheBounds": {
"bottom": -2.003750834278914E7,
"left": -2.0037508342789244E7,
"leftBottom": {
"x": -2.0037508342789244E7,
"y": -2.003750834278914E7
},
"right": 2.0037508342789244E7,
"rightTop": {
"x": 2.0037508342789244E7,
"y": 2.0037508342789095E7
},
"top": 2.0037508342789095E7
},
"createNewTileVersion": false,
"dataConnectionString": "../../samples/data/China400/China400.smwu",
"epsgCode": -1,
"format": "PNG",
"mapName": "China",
"originalPoint": {
"x": -2.0037508342789244E7,
"y": 2.0037508342789095E7
},
"parentTileVersion": null,
"refMapRestAdress": "http://localhost:8090/iserver/services/map-china400/rest/maps/China",
"resolutions": [317.49999999999994],
"scaleDenominators": [1200000],
"storageID": "aa",
"storeConfig": {
"fdfsTrackers": ["192.168.122.44:22122"],
"fdhtGroups": [
["192.168.122.44:11411"]
],
"type": "FastDFS"
},
"tileSize": "SIZE_256",
"transparent": false,
"tileType":"Image"
},
"state": {
"analystBlankPercentage": 0,
"buildingScale": {
"completed": 0,
"completedBytes": 0,
"completedRegion": null,
"failedRegion": null,
"matrixes": [{
"columnCount": 494,
"rowCount": 494,
"startingIndex": {
"columnIndex": 0,
"rowIndex": 0
}
}],
"nextIndex": {
"columnIndex": 0,
"rowIndex": 0
},
"scaleDenominator": 1200000,
"total": 244036,
"totalMatrix": null,
"workerBuildingInfos": null
},
"completed": 0,
"completedBytes": 0,
"completedScale": [],
"deployedWorkerId": [],
"elapsedTime": 0,
"masterAddress": "http://localhost:8090/iserver/services/tilemaster",
"remainTime": 0,
"runState": "BUILDING",
"scaleConfigs": [{
"cacheRegions": [],
"excludeRegions": [],
"scaleDenominator": 1200000,
"tileBoundsHeight": "81279.99999999999",
"tileBoundsWidth": "81279.99999999999"
}],
"scaleInfos": [{
"completed": 0,
"completedBytes": 0,
"completedRegion": null,
"failedRegion": null,
"matrixes": [{
"columnCount": 494,
"rowCount": 494,
"startingIndex": {
"columnIndex": 0,
"rowIndex": 0
}
}],
"scaleDenominator": 1200000,
"total": 244036,
"totalMatrix": null,
"workerBuildingInfos": null
}],
"speedPerSecond": 0,
"tasks": [],
"tasksToRetry": [],
"tileMatrixEdgeCount": 20,
"total": 244036
}
},
"newResourceID": "c9575f3c-c417-4ef9-a4da-9b0aa2c68d32",
"newResourceLocation": "http://localhost:8090/iserver/manager/tileservice/jobs/c9575f3c-c417-4ef9-a4da-9b0aa2c68d32.rjson",
"postResultType": "CreateChild",
"succeed": true
}
访问生成的子资源地址 http://localhost:8090/iserver/manager/tileservice/jobs/c9575f3c-c417-4ef9-a4da-9b0aa2c68d32,即可查看创建的切图任务的状态详见tileJob。
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 tileJobs 资源是否存在,或者客户端是否有权限访问 tileJobs 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 tileJobs 资源是否支持<format>格式的表述。