UNPKG

geotiff-no-data

Version:

Get the Numerical No Data Value for a GeoTIFF. Supports Infinity.

27 lines (21 loc) 724 B
const get_precise_no_data_value = require("geotiff-precise-no-data"); function getNoDataNumber(image) { const precise_no_data_value = get_precise_no_data_value(image); if (typeof precise_no_data_value === undefined) return; const no_data_value = Number(precise_no_data_value); if (isNaN(no_data_value)) return; return no_data_value; } if (typeof define === "function" && define.amd) { define(function() { return getNoDataNumber; }); } if (typeof module === "object") { module.exports = getNoDataNumber; module.exports.default = getNoDataNumber; } if (typeof window === "object") { window.getNoDataNumber = getNoDataNumber; } if (typeof self === "object") { self.getNoDataNumber = getNoDataNumber; }