https://github.com/derhuerst/combine-tiles
Combine map tiles into a single large image.
https://github.com/derhuerst/combine-tiles
combine join map osm stitch tiles
Last synced: about 1 year ago
JSON representation
Combine map tiles into a single large image.
- Host: GitHub
- URL: https://github.com/derhuerst/combine-tiles
- Owner: derhuerst
- License: isc
- Created: 2017-08-27T20:47:47.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-05-06T10:05:39.000Z (about 2 years ago)
- Last Synced: 2025-04-15T04:56:12.254Z (about 1 year ago)
- Topics: combine, join, map, osm, stitch, tiles
- Language: JavaScript
- Homepage: https://github.com/derhuerst/combine-tiles
- Size: 85 KB
- Stars: 16
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# combine-tiles
**Combine map tiles into a single large image.** Uses the great [`sharp` package](https://www.npmjs.com/package/sharp) for efficiency. Similar to [abacus](https://github.com/mapbox/abaculus#abaculus) and [merge-tiles](https://github.com/stadt-bielefeld/merge-tiles#merge-tiles).
[](https://www.npmjs.com/package/combine-tiles)


[](https://github.com/sponsors/derhuerst)
[](https://twitter.com/derhuerst)
## Installing
```shell
npm install combine-tiles
```
## Usage
Check out the [`example` directory](example)!
```js
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](https://github.com/mapbox/tilebelt#features) to convert bounding boxes into `[x, y, zoom]` tiles or [tile-cover](https://github.com/mapbox/tile-cover#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](https://github.com/derhuerst/combine-tiles/issues).