0.0.21 • Published 1 year ago

cog-tiler v0.0.21

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

cog-tiler

Overview

This package allows you to read Cloud Optimized GeoTIFF (COG) files and generate PNG images from xyz tiles. It utilizes geotiff.js and node-canvas under the hood.

Installation

npm install cog-tiler

Usage Example

app.get('/tiles/:z/:x/:y', async (req, res) => {
    const {x: xs,y: ys,z: zs} = req.params;
    const x = Number(xs);
    const y = Number(ys);
    const z = Number(zs);
    const tiff = await fromFile(path.resolve(process.cwd(), "data/sample.tif"));
    const image = await tiff.readImage(x, y, z);
    tiff.close();
    res.setHeader("Content-Type", "image/png");
    res.send(image);
});

License

MIT

0.0.21

1 year ago

0.0.20

1 year ago

0.0.19

1 year ago

0.0.18

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago