项目作者: AMDmi3

项目描述 :
Map tile processing tool
高级语言: C
项目地址: git://github.com/AMDmi3/tiletool.git
创建时间: 2012-04-28T19:50:58Z
项目社区:https://github.com/AMDmi3/tiletool

开源协议:GNU General Public License v3.0

下载


tiletool

Build Status

A tool for processing pregenerated sets of digital map tiles.

Each tile of lower zoom covers 4x more area, so it has 4x more features
and thus is 4x harder to render. Because of that, for some renderers
lower zoom tiles are not frequently updated and/or contain much less
features than higher zoom tiles, which is not really good. Main purpose
of this utility is to fix or at least improve this situation, as it
allows to render lowzoom tiles using higher zooms. It also allows to
blend semitransparent overlays with the tileset, producing full-fledged
map tiles without producing extra load on renderers.

Features

  • Generation of lower-level tiles from higher-level
  • Applying semitransparent overlays
  • Merging several tilesets together
  • Running arbitrary commands on tiles

Building

Only required dependencies are cmake and libpng. To compile:

  1. cmake . && make

To run tests, after building run:

  1. make test

To install systemwide:

  1. make install

Usage

  1. tiletool <OPTIONS>
  2. Options:
  3. -0..-9
  4. Set png compression level. Default is 2.
  5. -b, --input-bounds=<BBOX>
  6. Limit processing with bounding box (implies same limit to
  7. output).
  8. -B, --output-bounds=<BBOX>
  9. Limit output with bounding box.
  10. You may use -B when you need all tiles processed, but only
  11. specific subset of tiles written.
  12. There are two ways of specifying bounding boxes:
  13. zoom/x/y
  14. bbox is limited by tile with specified zoom and coordinates
  15. for example, -b 8/0/0 is upper-leftmost tile at zoom 8.
  16. Ranges are supported for x and y values, for example
  17. -b 5/1-12/5-9
  18. left,bottom,right,top
  19. Usual bounding box in geographical coordinates. For example:
  20. 37.3,55.53,37.93,55.95 - approximate bbox for Moscow (Russia)
  21. -z, --input-zoom=<ZOOM or MINZOOM-MAXZOOM>
  22. Specify which zoom (or zoom range) will be used for input tiles.
  23. -Z, --output-zoom=<ZOOM or MINZOOM-MAXZOOM>
  24. Specify for which zoom (or zoom range) tiles will be generated.
  25. One of above two options must be specified. If input zoom is not
  26. specified, it's set to (max output zoom + 1). If output zoom is
  27. not specified, it's set to 0-(min output zoom).
  28. For example, if you have level 6 tiles and you need to generate
  29. level 0-5 tiles based on it, you may either specify:
  30. -z 6 -Z 0-5
  31. -z 6 (output zoom is automatically set to 0-5)
  32. -Z 0-5 (input zoom is automatically set to 6)
  33. Ranges must not be adjascent, for example you may generate level 0
  34. tile based on level 6 tiles:
  35. -z 0 -Z 6
  36. -e, --empty-tile=<PATH>
  37. Specify a file to be used instead of tiles which are not found in
  38. the input set. You may omit it if your input tile set is complete,
  39. but the process will fail if empty tile is not set and input tile
  40. is missing.
  41. -j, --jobs=<N>
  42. Set maximum number of spawned child processes. By default it is 0
  43. and no child processes are spawned, all tiles are processed
  44. sequentionally. If this is > 0, tile loading and merging is still
  45. done sequentionally (this can't be paralleled), but overlay
  46. loading/applying, and saving for each tile is done in a child
  47. process. Note that -j 0 (no parallelization) is not the same as
  48. -j 1 (one child).
  49. -i, --input=<INPUT TILESET>
  50. Specify path to directory which contains input tiles.
  51. You may specify this option multiple times to provide fallback
  52. tilesets.
  53. -o, --output=<OUTPUT TILESET>
  54. Specify path to directory to store output tiles in. Required.
  55. -l, --overlay=<OVERLAY TILESET>
  56. Specify path to overlay which will be blended with output tiles.
  57. You may specify this option multiple times to use multiple
  58. overlays.
  59. -c, --postcmd=<COMMAND>
  60. Specify a command to be run on a newly saved tile. You may want to
  61. set this to, for example, 'optipng -quiet -o1'.
  62. -v, --verbose
  63. Increase verbosity.
  64. -h, --help
  65. Display help on options.

Examples

  1. For example, you have zoom 8 tiles in mapnik/ directory, and set
    of transparent tiles with captions in a captions/ directory. You may
    generate all missing zooms (0-7) with the following command:

    1. tiletool -z 8 -l captions -i mapnik -o output

    resulting tiles will be saved in output/.

  2. Now, you have some tiles in the original tileset updated and you want
    to only regenerate affected lowzoom tiles. Unfortunately, you need to
    generate all lowzoom tiles from scratch (your previous output is
    unuseable as it has overlay applied), but fortunately you don’t need to
    recreated unaffected tiles, thus though you need to walk whole tile tree,
    most expensive operations (blending and png saving) will only be run on
    updated tiles.

    For example, Moscow fits into two tiles on z8, so if these are updated,
    you should run:

    1. tiletool -B 8/154/79-80 -z 8 -o captions -i mapnik -o output
  3. You may use optipng to optimized your tiles to save space & traffic:

    1. tiletool -c 'optipng -quiet -o1' -z 8 -o captions -i mapnik -o output

    You may also add -1 to spend less time compressing tiles that will
    be recompressed anyway.

License

GNU GPLv3+, see COPYING.

Bundled libttip (image processing library) is licensed under LGPLv3+.

Author