s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
34 lines • 1.36 kB
TypeScript
import type { BBox, VectorPoint } from '../geometry';
/**
* Convert lat/lon to MGRS.
* @param ll - Array with longitude and latitude on a
* WGS84 ellipsoid.
* @param accuracy - Accuracy in digits (5 for 1 m, 4 for 10 m, 3 for
* 100 m, 2 for 1 km, 1 for 10 km or 0 for 100 km). Optional, default is 5.
* @returns the MGRS string for the given location and accuracy.
*/
export declare function mgrsForward(ll: VectorPoint, accuracy?: number): string;
/**
* Convert MGRS to lat/lon bounding box.
* @param mgrs - MGRS string.
* @returns An array with left (longitude),
* bottom (latitude), right
* (longitude) and top (latitude) values in WGS84, representing the
* bounding box for the provided MGRS reference.
*/
export declare function mgrsInverse(mgrs: string): undefined | BBox;
/**
* Convert MGRS to lat/lon.
* @param mgrs - MGRS string.
* @returns The center of the MGRS bounding box
*/
export declare function mgrsToPoint(mgrs: string): undefined | VectorPoint;
/**
* Calculates the MGRS letter designator for the given latitude.
* (Not intended for public API, only exported for testing.)
* @param latitude - The latitude in WGS84 to get the letter designator
* for.
* @returns The letter designator.
*/
export declare function mgrsGetLetterDesignator(latitude: number): string;
//# sourceMappingURL=mgrs.d.ts.map