Skip to content

stadt-bielefeld/merge-tiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

merge-tiles

It allows you to reduce tiles of a directory of wms-downloader tiles.

Installation

01 NodeJS and NPM

Windows: Use the installer from https://nodejs.org/

Ubuntu / Debian:

sudo apt install nodejs npm

02 GraphicsMagick

Windows: Use the installer from http://www.graphicsmagick.org/

Ubuntu / Debian:

sudo apt install graphicsmagick

03 merge-tiles

Use terminal:

npm i -g merge-tiles

Get started

Command line:

Options:
   -h, --help              Output usage information
   -V, --version           Output the version number
   -i, --input [path]      Input directory of wms-downloader tiles. Default is the current directory.
   -o, --output [path]     Output directory of single tile. Default is the current directory.
   -w, --workers [number]  Count of graphicsmagick workers. Default is 1.
   -f, --formats [ext]     List of formats (gif_tif_png_jpg). Convert the single tile in the listed formats.

With default options:

cd dirOfTiles
merge

With custom options:

merge -i ./input -o ./output -w 2 -f tif_gif_jpg

Node.js:

const merge = require('merge-tiles');

let options = {
  inputDir: __dirname + '/input',
  outputDir: __dirname + '/output',
  outputFormats: ['gif', 'jpg'],
  workers: 4
};

merge(options, (err) => {
  if (err) {
    console.error(err);
  } else {
    console.log('Merged!');
  }
});

Documentation

Developer

Build api documentation:

npm run build-api-doc

License

MIT