remove left-over geohash grid code (#30312) (#30373)

This commit is contained in:
Nathan Reese 2019-02-07 07:50:42 -07:00 committed by GitHub
parent fc7a0c4417
commit dd4031a2a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 60 deletions

View file

@ -1,46 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
const ZOOM_TO_PRECISION = {
"0": 1,
"1": 2,
"2": 2,
"3": 2,
"4": 3,
"5": 3,
"6": 4,
"7": 4,
"8": 4,
"9": 5,
"10": 5,
"11": 6,
"12": 6,
"13": 6,
"14": 7,
"15": 7,
"16": 8,
"17": 8,
"18": 8,
"19": 9,
"20": 9,
"21": 10,
"22": 10,
"23": 10,
"24": 11,
"25": 11,
"26": 12,
"27": 12,
"28": 12,
"29": 12,
"30": 12
};
export const getGeohashPrecisionForZoom = (zoom) => {
let zoomNormalized = Math.round(zoom);
zoomNormalized = Math.max(0, Math.min(zoomNormalized, 30));
return ZOOM_TO_PRECISION[zoomNormalized];
};

View file

@ -1,14 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { getGeohashPrecisionForZoom } from './zoom_to_precision';
it('getGeohashPrecisionForZoom', () => {
expect(getGeohashPrecisionForZoom(-1)).toEqual(1);
expect(getGeohashPrecisionForZoom(40)).toEqual(12);
expect(getGeohashPrecisionForZoom(20)).toEqual(9);
expect(getGeohashPrecisionForZoom(19)).toEqual(9);
});