![@thi.ng/pixel-io-geotiff](https://media.thi.ng/umbrella/banners-20220914/thing-pixel-io-geotiff.svg?cf8538e7)
![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)
This project is part of the
@thi.ng/umbrella monorepo.
About
GeoTIFF reader support for @thi.ng/pixel.
![Pseudo-3D DEM visualization using hidden lines plot](https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/pixel-io-geotiff/20230109-n45w121-crop-1280.jpg)
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
ALPHA - bleeding edge / work-in-progress
Search or submit any issues for this package
Installation
yarn add @thi.ng/pixel-io-geotiff
ES module import:
<script type="module" src="https://cdn.skypack.dev/@thi.ng/pixel-io-geotiff"></script>
Skypack documentation
For Node.js REPL:
const pixelIoGeotiff = await import("@thi.ng/pixel-io-geotiff");
Package sizes (brotli'd, pre-treeshake): ESM: 402 bytes
Dependencies
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 } from "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 Karsten Schmidt // Apache License 2.0