# is-cog

> Super Light and Fast Method for Checking if a TIFF is a Cloud Optimized GeoTIFF

Latest version **0.0.1** (published 2020-11-17) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install is-cog
pnpm add is-cog
yarn add is-cog
bun add is-cog
```

## 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.0.1 |
| Published | 2020-11-17 |
| First published | 2020-11-17 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Daniel J. Dufour |
| Maintainers | danieljdufour |
| Keywords | cog, file, geotiff, tiff |

## Links

- npm: https://www.npmjs.com/package/is-cog
- Repository: https://github.com/GeoTIFF/is-cog
- Homepage: https://github.com/GeoTIFF/is-cog#readme
- Issues: https://github.com/GeoTIFF/is-cog/issues
- npm.io page: https://npm.io/package/is-cog

## Dependencies (3)

- [id-tif](https://npm.io/package/id-tif.md) 0.0.1
- [has-bytes](https://npm.io/package/has-bytes.md) 0.0.2
- [is-geotiff](https://npm.io/package/is-geotiff.md) 0.0.1

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2020-11-17

## README

:warning: This package is under development.  Please report an issues here: https://github.com/geotiff/is-cog/issues
# is-cog
Super Light and Fast Method for Checking if a TIFF is a Cloud Optimized GeoTIFF

# how does it work
1. It uses [id-tif](https://github.com/DanielJDufour/id-tif) to check if the file is a TIFF. 
2. If it is a TIFF, it uses [is-geotiff](https://github.com/GeoTIFF/is-geotiff) to check if the file is a GeoTIFF.
3. If it is a GeoTIFF, it uses [has-bytes](https://github.com/DanielJDufour/has-bytes) to check if the bytes associated with the following tags are present: TileWidth, TileLength, TileOffsets, and TileByteCounts.

# install
```bash
npm install is-cog
```

# usage
```js
const fs = require("fs");
const isCOG = require("is-cog");

const buffer = fs.readFileSync("./landsat_scene.tiff");

const { is_cog, is_geotiff, is_tiff } = isCOG({
    data: buffer,
    debug: false // set debug to true for increased logging
});
// is_cog is true
// is_geotiff is true
// is_tiff is true
```

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