The server in which the caching task is created is the master caching node(TileMaster), the other cluster child nodes are child caching nodes(TileWorker). Preparation of the caching environment and storage, operations like creating task and monitoring, both are done on the master node, and there is nothing to be done on the child nodes. After the caching task is created, the data to be cached will be deployed on the child nodes automatically. If the data on the master node is changed, it will be automatically synchronized to the child nodes. About the principle and internal communication mechanism of the distributed tiling, please refer to: Distributed tiling mechanism.
Create distributed tiling task and set parameters
Access the iServer Manager of the master caching node, click Clusters>Distributed Tiles>Create tiling task, and then set parameters including service component, map, tile type, caching scale, etc.
General settings
- Service component: the list shows all published map service components.
- Map: all the maps contained by the current service component.
- Tile type: the type of the tile, currently supports map, vector, and attribute tiles. Map tile means to make caches for the whole map, and the tile type is image type like raster data. Vector and attribute types mean to make caches for single or multiple specified vector layers. For more information about tile type, please refer to: Tile type.
- Storage type: the type of the tiles storage. For more information, please refer to: Tile type.
- If the tile type is map tile, the supported storage type includes FastDFS, MongoDB, OTS, SMTiles, MBTiles, UGCV5 and GeoPackage
- If the tile type is vector tile, the supported storage type is SVTiles
- If the tile type is attribute tile, the supported storage type is UTFGrid
- UGCV5 Cache Format: includes original and compact types, valid when storage type is UGCV5. UGCV5 cache includes two parts: index file (*.sci) and cached data. In original cache, the cached images will be stored on the disk without any compression and encryption, ie., the cached data are those generated images, and wich can be read directly. The compact type means the cached data are the files (*.cf) generated by compressing and encrypting the original images. Compared with original type, compact type has smaller file size, which reduces the copy and transfer time, and is safer because of using encryption.
- Storage path: the storage path of the tiles. When the storage type is SMTiles, UGCV5, UTFGrid and SVTiles, the default path is the default output path(output) of the current product package. For details please refer to: Tile type.
- Storage ID: the ID of distributed storage location. When the storage type is FastDFS and MongoDB, it is needed to choose the ID of the created distributed caching library. If the storage location is not created, please add distributed caching library.
- Scale scheme: it is used to assist determining the caching scales. The possible schemes are:
- Google Maps/Bing Maps: Only supports the maps with Web Mercator coordinate system(EPSG Code: 3857)
- Tianditu: Only supports the maps with WGS 1984(EPSG Code: 4326) and Web Mercator coordinate system(EPSG Code: 3857). It uses 2-18 scale levels by default. You can choose it according to your requirement
- GeoPackage scale: When the Storage type is GeoPackage, it will use this option.
- Recommended scales.
- Customized scales: You can input the scales directly
In which, the specific scales of Google Maps/Bing Maps and Tian Di Map schemes are:
table1 scale grade
Level |
Scale |
Level |
Scale |
Level |
Scale |
Level |
Scale |
0 |
1/591658710.9091312 |
5 |
1/18489334.71591035 |
10 |
1/577791.7098721984 |
15 |
1/18055.9909335062 |
1 |
1/295829355.4545656 |
6 |
1/9244667.357955175 |
11 |
1/288895.8549360992 |
16 |
1/9027.9954667531 |
2 |
1/147914677.7272828 |
7 |
1/4622333.678977587 |
12 |
1/144447.9274680496 |
17 |
1/4513.99773337655 |
3 |
1/73957338.8636414 |
8 |
1/2311166.8394887936 |
13 |
1/72223.9637340248 |
18 |
1/2256.998866688275 |
4 |
1/36978669.4318207 |
9 |
1/1155583.4197443968 |
14 |
1/36111.9818670124 |
19 |
1/1128.4994333441375 |
- Cache scale: it lists the selected scales. You can input the denominator of the scale and click "Add the denominator of the scale" to add the scale to the list. If you have chosen Google Maps/Bing Maps or Recommended scales scheme, you can select the appropriate scale range. You can also remove a scale from the list. The recommended method to select the cache scales is: firstly figure out what scales will be used in browsing the map on the client, then set the scales, so as that the client side can use map tiles when zooming in and out.
Notice (except UGCV5 tiles):
- If the current map is not set in a fixed scale, the added scale in caching will be set as the fixed scale of the map.
- If the current map is set in a fixed scale and the added scale in caching is different from that fixed scale, the caching scale will be added to the fixed map scale after it starts to make cache. After that, when making cache for the same map, it will add the caching scales to the fixed map scale again.
- Cache bounds: it defines the map range to be cached, the format is like: -180, -90, 180, 90. It is the full map by default.
- Original point: Used to calculate the tile row number and column number. In general, it is the left top corner of the caching extent. While standard tiles use the original point defined in standard.
- MBTiles standard defines the left bottom corner as the default original point of the global extent.
- GeoPackage standard defines the left top corner of the maximum extent under current coordinate system. For example, if the coordinate system is WGS1984, then the default original point is (-180.0,90.0)
- Tile size: the generated tile size, supporting 256*256 and 512*512.
Note: If you choose the GeoPackage format as the storage type, the cache scale will change automatically with the tile size.
- Whether to use the cloud service caching scheme: whether to use the caching scheme which is in line with SuperMap cloud service standard. The map must be Web Mercator coordinates system(EPSG Code: 3857) or WGS 1984(EPSG Code: 4326). After checking this option, you can set the caching range by the specified region data.
Set map tile
- Picture format: Map tiles supports PNG, JPG, GIF, JPG_PNG mixed format. If setting to PNG and the color value number of the current map is less than 256, SuperMap iServer will use PNG 8 format to save the storage size. When you partitioning image map, if you want to set transparent and size for tile, it is recommended to use JPG_PNG format.
- Picture compression ratio: This setting is enabled when you choose JPG or JPG_PNG as picture format. The range is (0, 1.0]. The default value is 0.75. The smaller the ratio is, the less space it occupies.
- Transparent background: Used to set whether the tile background is transparent or not for map tiles. If checked, the generated map tiles will have a transparent background; otherwise it will keep original background color.
- Whether to open the data preprocessing: if yes, the Distributed Map Tiling service will firstly process the data, and then make cache. It will be checked by default, and the default range is 50*50. The mechanism is:
- Divide the map into grids with the columns and rows, and then each grid is marked as with data or no data.
- By preprocessing the data, the ranges without data will be marked so that it will ignore those ranges in caching to improve the caching speed. This way is very useful when the map has more irregular shapes or have more empty areas.
- The preprocessed result will be saved in the file (SuperMap iServer...\webapps\iserver\WEB-INF\config\dataPreProcessResult\), each result is a file with the same name of the map. If the set column and row numbers are the same as last, the result will be reused, if not, it will be updated. If you want to delete the result, just delete the file.
- Whether to enable automatic avoidance: not by default. When the labels on the map are overlapped, some labels will be hidden automatically. If enabled, the position of some labels will be changed a little to display the overlapped labels to display the labels as more as possible
- Whether to enable md5 validation: whether to compare the data in the caching nodes with that in the master node in md5 way when sending the cache data. If not checked, it will compare them just by the file name and size. If checked, it will be more rigorous and reliable but take more time.
Set vector tile
- Whether to include attributes: sets whether the vector tile including the attribute fields.
- Thinning tolerance: thin the lines and regions in the vector layer according to the tolerance value. The unit is pixel, the parameter type is int, and the value is 0 by default. If you set the thinning tolerance, when caching it will combine the coordinates series within the tolerance based on Douglas-Peucker Algorithm to reduce the complexity of geometries. Setting thinning tolerance will reduce the accuracy of data and reduce the data size, you can set it according to the needs.
As shown above, the basic idea is: the start and end points for each curve can make a straight line(line a in Figure 1), calculate the distance between each point and the straight line, and get the maximum value dmax(line b in Figure 1), and then compare dmax and the tolerance D:
- If dmax is smaller than D, the middle points in the curve will be deleted:
- If dmax is not smaller than D, it will keep the corresponding point of dmax(point c in Figure 1), and divide the curve into two parts by this point, then use above method for each part.
- Layer: vector layer to create vector tiles. If the map is set with visible scale ranges, please choose the layer which is within the range.
- Expansion pixel: expand some pixel around the tile and then clip the features, the smallest value is 2, and the default is half of the feature width such as half of the point diameter, half of the line width, half of the region boundary width. This setting can avoid repeated tile edges created.
- Attributes: attribute fields included in vector tiles, all the attribute fields by default.
- Query attributes: attribute fields which are supported to keyword query in vector tiles.
Set attribute tile
- UTFGrid layer: vetor layer to make attribute tile. A cache task only supports caching for one vector layer.
- UTFGrid grid size: the size of each grid, the unit is pixel, the default is 4, often used values are a power of 2, such as 1, 2, 4, 8. Grid is the basic unit to store the attribute information in the tiles. A grid stores one piece of attribute information, which is the smallest unit of mouse interaction. If the grid size is very big, it will affect the mouse interaction effect. The recommended value is 4, e.g., if the tile size is 256*256 and the grid size is 4*4, a tile will contain 64*64 grids.
Create new-version tiles and append tiles
After the setting, click Create Cache Task to create a task.
If the tiles with the same map name, tile size and transparency parameter have existed, that is, the file name(*.smtiles) or the tile set name in the same tile library has existed, there will be the following two situations:
- For the tiles stored in a single computer such as SMTiles, MBTiles, UGCV5, UTFGrid and SVTiles, it will add the tiles in the same tile file(*.smtiles), overwrite the existed tiles in the same position, or add new tiles.
- For distributed stored tiles, it will pop up the message "the cache has existed, whether to add a new version?". If yes, it will create a new version; if no, you need to specify a version, and it will add tiles to this version, overwrite the existed tiles in the same position, or add new tiles.
Detailed information about tiles version, please refer to: tile set version.
View task list
In the Distributed Tiling page, you can view all caching tasks in process and finished on the current server, also you can view the basic information, progress, etc for each task.
You can stop, start, delete the tasks, and can click the map name in the task to check more detailed task information, progress information, progress in each scale and each caching node, and can restart the task to make caching once again.
For the completed task, you can view the map name corresponding to the current task, the component name, task start time, task cost, tiles number, tile type and tile storage type, and storage location, etc.
Monitor caching progress
In the caching task list, click the map name to view the status information, including tile storage, tile configuration, task progress(dynamically displayed caching speed, time), caching time statistics, tile version, storage(occupied storage and expected occupied storage) information. You can pause, start, restart the task, and monitor the status of each TileWorker in the caching task.