Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 5 days 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 (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-06T10:05:39.000Z (6 months ago)
- Last Synced: 2024-10-03T23:59:03.301Z (about 1 month ago)
- Topics: combine, join, map, osm, stitch, tiles
- Language: JavaScript
- Homepage: https://github.com/derhuerst/combine-tiles
- Size: 85 KB
- Stars: 14
- Watchers: 3
- 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).
[![npm version](https://img.shields.io/npm/v/combine-tiles.svg)](https://www.npmjs.com/package/combine-tiles)
![ISC-licensed](https://img.shields.io/github/license/derhuerst/combine-tiles.svg)
![minimum Node.js version](https://img.shields.io/node/v/combine-tiles.svg)
[![support me via GitHub Sponsors](https://img.shields.io/badge/support%20me-donate-fa7664.svg)](https://github.com/sponsors/derhuerst)
[![chat with me on Twitter](https://img.shields.io/badge/chat%20with%20me-on%20Twitter-1da1f2.svg)](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).