[!NOTE]
This is one of 201 standalone projects, maintained as part
of the @thi.ng/umbrella monorepo
and anti-framework.
🚀 Please help me to work full-time on these projects by sponsoring me on
GitHub. Thank you! ❤️
About
GeoTIFF reader support for @thi.ng/pixel.
This package is only intended to simplify obtaining DEM (elevation) data and not
aimed at general
GeoTIFF
functionality. For the latter we recommend using the wrapped
geotiff.js package directly.
Status
STABLE - used in production
Search or submit any issues for this package
Installation
yarn add @thi.ng/pixel-io-geotiff
ESM import:
import * as geo from "@thi.ng/pixel-io-geotiff";
Browser ESM import:
<script type="module" src="https://esm.run/@thi.ng/pixel-io-geotiff"></script>
JSDelivr documentation
For Node.js REPL:
const geo = await import("@thi.ng/pixel-io-geotiff");
Package sizes (brotli'd, pre-treeshake): ESM: 399 bytes
Dependencies
Note: @thi.ng/api is in most cases a type-only import (not used at runtime)
API
Generated API docs
import { GRAY16 } from "@thi.ng/pixel";
import { readGeoTiff } from "@thi.ng/pixel-io-geotiff";
import { asPGM16 } from "@thi.ng/pixel-io-netpbm";
import { readFileSync } "node:fs";
const result = await readGeoTiff(readFileSync("USGS_1_n37w119_20211004.tif"));
writeFileSync("n37w119.pgm", asPGM16(result.img.as(GRAY16)));
result.tiff.getGDALMetadata(0);
Authors
If this project contributes to an academic publication, please cite it as:
@misc{thing-pixel-io-geotiff,
title = "@thi.ng/pixel-io-geotiff",
author = "Karsten Schmidt",
note = "https://thi.ng/pixel-io-geotiff",
year = 2023
}
License
© 2023 - 2025 Karsten Schmidt // Apache License 2.0