Skip to content

Get the Precise No Data Value for a GeoTIFF. Avoid Floating Point Arithmetic Issues.

License

Notifications You must be signed in to change notification settings

GeoTIFF/geotiff-precise-no-data

Repository files navigation

geotiff-precise-no-data

Get the Precise No Data Value for a GeoTIFF. Avoid Floating Point Arithmetic Issues.

install

npm install geotiff-precise-no-data

usage

import { fromFile } from "geotiff";
import getPreciseNoDataValue from "geotiff-precise-no-data";

const tif = await fromFile("vestfold.tif");
const image = await tif.getImage();
getPreciseNoDataValue(image);
"-3.39999999999999996e+38"

// get raw value
getPreciseNoDataValue(image, { raw: true });
"-3.39999999999999996e+38\u0000"

// pass in file directory object
// like { GDAL_NODATA: "-3.39999999999999996e+38\u0000", ... }
getPreciseNoDataValue(image.fileDirectory);
"-3.39999999999999996e+38"

// normalizes infinity
const tif = await fromFile("abetow-ERD2018-EBIRD_SCIENCE-20191109-a5cf4cb2_hr_2018_abundance_median.tiff");
const image = await tif.getImage();
getPreciseNoDataValue(image);
"-Infinity"

About

Get the Precise No Data Value for a GeoTIFF. Avoid Floating Point Arithmetic Issues.

Resources

License

Stars

Watchers

Forks

Packages

No packages published