Map Tile(Multi-task)


The traditional way to generate map tiles is in a single task, and with the development of technology, the quantity of data is more and more huge, and generating tiles in a single task needs more and more time. if you want to generate tiles for a map like the China Map, it will take for dozens of days

To improve the generating-tiles efficiency, introduces the feature of generating tiles in multiple tasks which allows you to open multiple threads in a machine or several machines to generate tiles in parallel. The feature makes the most of hardware resources of computers thereby improves the efficiency, stability and reliability of generating tiles and online services.

Theory of Map Tile(Multi-task)

Theory of Map Tile(Multi-task) is to divide the task of generating tiles into a lot of child tasks according to the scales, the geographic ranges, etc. of maps, and then deploys these child tasks at a shared directory. Start multiple threads at several machines and every thread gets a task from a specified directory and then run it. All results will be saved into the same folder and the folder can be a local one or in a MongoDB database.

MultiProcessTilesPrinciple

Key points of Map Tile(Multi-task)

When performing the feature in , you should notice:

  • Datasources are read-only : Since multiple tasks access a datasource at the same time, the datasource will be occupied by one of tasks and other tasks can not access the datasource. Hence, before performing the feature Map Tile(Multi-task), you must re-open your datasoure in read-only mode and then save your workspace.
  • Divide tasks : You need to specify how many child tasks are required. The program will generate a sci file according to scales, tile ranges and so on and then divides the sci file into several child sci files.
  • A shared directory : A shared directory: After dividing tasks, a folder in the Working Directory is created for saving the sci file and all child sic files. And then set the directory as a shared directory to ensure other machines can read and write the directory, which means other machines can get tasks and save results conveniently.
  • Perform tasks : Other machines need to access the host machine successfully to perform the feature, hence, you should check whether the connection between host machine and other machines is open. You can enter an address like \\198.168.1.20(host ip) to check.