s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
41 lines • 1.51 kB
TypeScript
import type { Face, Point3D, S2CellId } from '../geometry';
/** An Uint64Cell contains all the information needed to uniquely identify a 64-bit cell */
export interface Uint64Cell {
low: number;
high: number;
}
/** The 64-bit cell id in BigInt, Number, or Uint64Cell form */
export type Uint64 = number | S2CellId | Uint64Cell;
/**
* Convert a BigInt to an Uint64Cell representation
* @param id - the 64-bit cell id in BigInt or number form
* @returns - an Uint64Cell with the appropriate id and functions
*/
export declare function toCell(id: Uint64): Uint64Cell;
/**
* Convert a lon/lat to an Uint64Cell representation
* @param lon - longitude
* @param lat - latitude
* @returns - an Uint64Cell with the appropriate id and functions
*/
export declare function fromLonLat(lon: number, lat: number): Uint64Cell;
/**
* Convert a face/s/t to an Uint64Cell representation
* @param face - face on the sphere
* @param s - x position
* @param t - y position
* @returns - an Uint64Cell with the appropriate id and functions
*/
export declare function fromFaceST(face: Face, s: number, t: number): Uint64Cell;
/**
* @param point - a vector point on the sphere
* @returns - an Uint64Cell with the appropriate id and functions
*/
export declare function fromS2Point(point: Point3D): Uint64Cell;
/**
* @param a - the first cell
* @param b - the second cell
* @returns -1 | 0 | 1
*/
export declare function compare(a: Uint64Cell, b: Uint64Cell): -1 | 0 | 1;
//# sourceMappingURL=uint64.d.ts.map