export function getHexagonEdgeLengthAvg()

in lib/h3core.js [1666:1684]


export function getHexagonEdgeLengthAvg(res, unit) {
    validateRes(res);
    const out = C._malloc(SZ_DBL);
    try {
        switch (unit) {
            case UNITS.m:
                throwIfError(H3.getHexagonEdgeLengthAvgM(res, out));
                break;
            case UNITS.km:
                throwIfError(H3.getHexagonEdgeLengthAvgKm(res, out));
                break;
            default:
                throw JSBindingError(E_UNKNOWN_UNIT, unit);
        }
        return readDoubleFromPointer(out);
    } finally {
        C._free(out);
    }
}