# geotiff-tile-web-worker

> Create a GeoTIFF Tile using an Inline Web Worker

Latest version **0.11.0** (published 2024-02-25) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install geotiff-tile-web-worker
pnpm add geotiff-tile-web-worker
yarn add geotiff-tile-web-worker
bun add geotiff-tile-web-worker
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.11.0 |
| Published | 2024-02-25 |
| First published | 2022-11-08 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 7.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Daniel J. Dufour |
| Maintainers | danieljdufour |
| Keywords | geotiff, tile, web, worker |

## Links

- npm: https://www.npmjs.com/package/geotiff-tile-web-worker
- Repository: https://github.com/GeoTIFF/geotiff-tile-web-worker
- Homepage: https://github.com/GeoTIFF/geotiff-tile-web-worker#readme
- Issues: https://github.com/GeoTIFF/geotiff-tile-web-worker/issues
- npm.io page: https://npm.io/package/geotiff-tile-web-worker

## Dependencies (7)

- [xdim](https://npm.io/package/xdim.md) ^1.10.1
- [geotiff](https://npm.io/package/geotiff.md) ^2.1.3
- [get-depth](https://npm.io/package/get-depth.md) ^0.0.3
- [microlink](https://npm.io/package/microlink.md) 0.3.0
- [quick-lru](https://npm.io/package/quick-lru.md) ^7.0.0
- [frame-worker](https://npm.io/package/frame-worker.md) ^0.3.0
- [geotiff-tile](https://npm.io/package/geotiff-tile.md) ^0.20.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.11.0 (latest) — 2024-02-25
- 0.10.0 — 2024-01-14
- 0.9.1 — 2023-12-03
- 0.9.0 — 2023-12-03
- 0.8.2 — 2023-11-30
- 0.8.1 — 2023-11-19
- 0.8.0 — 2023-11-12
- 0.7.1 — 2023-11-12
- 0.7.0 — 2023-11-12
- 0.6.0 — 2023-11-11
- 0.5.1 — 2023-11-11
- 0.5.0 — 2023-08-12
- 0.4.0 — 2023-01-23
- 0.3.0 — 2023-01-17
- 0.2.1 — 2023-01-01
- … 2 more at https://npm.io/package/geotiff-tile-web-worker/versions

## README

# geotiff-tile-web-worker
Create a GeoTIFF Tile using an Inline Web Worker

## install
### via script tag
```html
<script src="https://unpkg.com/geotiff-tile-web-worker"></script>
```
### via terminal
```
npm install geotiff-tile-web-worker
```

## basic usage
```js
import { createWorker } from "geotiff-tile-web-worker";

const worker = createWorker();

const result = await worker.createTile({
  // url to a geotiff
  url: "https://storage.googleapis.com/pdd-stac/disasters/hurricane-harvey/0831/20170831_172754_101c_3b_Visual.tif",

  // bounding box of tile in format [xmin, ymin, xmax, ymax]
  bbox: [-95.976562, 29.535232, -95.888671, 29.611673]
});

// result is
{
  height: 256,
  width: 256,
  tile: [
    Uint8Array[...], // first band
    Uint8Array[...], // second band
    Uint8Array[...], // third band
  ]
}
```

## advanced usage
```js
import { createWorker } from "geotiff-tile-web-worker";

const worker = createWorker();

worker.createTile({
  // url to a GeoTIFF file
  url: "https://storage.googleapis.com/pdd-stac/disasters/hurricane-harvey/0831/20170831_172754_101c_3b_Visual.tif",

  // bounding box of tile in format [xmin, ymin, xmax, ymax]
  bbox: [-96.01226806640625, 29.616445727622548, -96.01089477539062, 29.61763959537609],

  /*** ALL PARAMETERS BELOW ARE OPTIONAL */

  // spatial reference system of the bounding box as an EPSG Code number
  // default is 4326
  bbox_srs: 4326,

  // geometry to clip by in GeoJSON format
  cutline: geojson,

  // spatial reference system of cutline
  // default is 4326
  cutline_srs: 4326,

  // set to higher number to increase logging
  // default is 0
  debug_level: 0,

  // over-ride no data value set in geotiff metadata
  geotiff_no_data: 0,

  // resampling method
  // default is "near"
  method: "max",

  // round pixel values to integers
  // default is false
  round: true,

  // override default nested tile array types
  tile_array_types: ["Array", "Uint8ClampedArray"],

  // if tile_array_types is not specified, choose the strategy for deciding which type of arrays:
  // auto - safest and default option, only uses typed array if it's sure there won't be any clamping
  // geotiff - use the same array types that geotiff.js uses (good if not stretching min or max)
  // untyped - use only untyped arrays
  // undefined - same as auto
  tile_array_types_strategy: "untyped",

  // layout using xdim layout syntax: https://github.com/danieljdufour/xdim
  tile_layout: "[band][row,column]",

  // projection of the tile as an EPSG code
  // default is 3857
  tile_srs: 3857,

  // tile height in pixel
  // default is 256
  tile_height: 512,

  // over-ride default "no data" value in output tile
  tile_no_data: 0,

  // width of tile in pixels
  // default is 256
  tile_width: 512,

  // whether to use overviews if available
  // default is true
  use_overview: false,

  // enable experimental turbocharging via proj-turbo
  // default is false
  turbo: false
})

// stop web worker
worker.terminate();
```

---
_Source: https://npm.io/package/geotiff-tile-web-worker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
