UNPKG

gis-tools-ts

Version:

A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.

62 lines 1.81 kB
import { averageInterpolation, idwInterpolation, lanczosInterpolation, nearestInterpolation, rgbaAverageInterpolation, rgbaIDWInterpolation, rgbaLanczosInterpolation, rgbaNearestInterpolation, } from './index.js'; export * from './average.js'; export * from './bilinear.js'; export * from './idw.js'; export * from './kriging.js'; export * from './lanczos.js'; export * from './nearest.js'; /** * Get the interpolation function based on the method type. * Options are: * - average * - nearest * - idw * - lanczos [default] * @param method - interpolation method as a string * @returns - interpolation function */ export function getInterpolation(method) { switch (method) { case 'average': return averageInterpolation; case 'nearest': return nearestInterpolation; case 'idw': return idwInterpolation; case 'lanczos': default: return lanczosInterpolation; } } /** * Get the interpolation function based on the method type. * Options are: * - average * - nearest * - idw * - lanczos [default] * @param method - interpolation method as a string * @returns - interpolation function */ export function getRGBAInterpolation(method) { switch (method) { case 'average': return rgbaAverageInterpolation; case 'nearest': return rgbaNearestInterpolation; case 'idw': return rgbaIDWInterpolation; case 'lanczos': default: return rgbaLanczosInterpolation; } } /** * Default function to get the value of a point * @param point - vector point to pull data from * @returns - the z value */ export function defaultGetInterpolateCurrentValue(point) { return point.z ?? 0; } //# sourceMappingURL=index.js.map