Skip to content

derhuerst/combine-tiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

combine-tiles

Combine map tiles into a single large image. Uses the great sharp package for efficiency. Similar to abacus and merge-tiles.

npm version ISC-licensed minimum Node.js version support me via GitHub Sponsors chat with me on Twitter

Installing

npm install combine-tiles

Usage

Check out the example directory!

const combineTiles = require('combine-tiles')

const size = 300
const tiles = [
	{x: 0, y: 0, file: '/path/to/0-0.png'},
	{x: 1, y: 0, file: '/path/to/1-0.png'},
	{x: 0, y: 1, file: '/path/to/0-1.png'},
	{x: 1, y: 1, file: '/path/to/1-1.png'}
]
const dest = '/path/to/combined.png'

await combineTiles(tiles, size, size, dest)

You may want to use tilebelt to convert bounding boxes into [x, y, zoom] tiles or tile-cover to generate a list of tiles in a bounding box.

Contributing

If you have a question or have difficulties using combine-tiles, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.