gis-tools-ts
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
62 lines • 1.78 kB
JavaScript
import { averageInterpolation, idwInterpolation, lanczosInterpolation, nearestInterpolation, rgbaAverageInterpolation, rgbaIDWInterpolation, rgbaLanczosInterpolation, rgbaNearestInterpolation, } from '.';
export * from './average';
export * from './bilinear';
export * from './idw';
export * from './kriging';
export * from './lanczos';
export * from './nearest';
/**
* 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