Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A javascript library for converting LL, UTM, USNG, and MGRS

License

NotificationsYou must be signed in to change notification settings

codice/usng.js

Repository files navigation

A version of usngs.js with bug fixes, enhancements, and extensive unit tests.

Build Status

USNG (U.S. National Grid)MGRS (Military Grid Reference System)

Features

  • Convert Lat/Lon bounding box to closest USNG
  • Convert Lat/Lon to UTM/UPS
  • Convert Lat/Lon point to USNG
  • Convert UTM/UPS to Lat/Lon
  • Convert USNG to UTM
  • Convert USNG to Lat/Lon
  • Convert Lat/Lon to MGRS

Usage

Example usage of this file with Cesium and OpenLayers can be found withinhttps://github.com/codice/ddf

varusng=require('usng.js');varconverter=newusng.Converter();varusngCoord=converter.LLBboxtoUSNG(north,south,east,west);varutmCoord=converter.LLtoUTM(lat,lon,utmcoords,zone);varutmUpsCoord=converter.LLtoUTMUPS(lat,lon)varusngCoord=converter.LLtoUSNG(lat,lon,precision);varllCoord=converter.UTMtoLL(UTMNorthing,UTMEasting,UTMZoneNumber,accuracy);llCoord=converter.UTMUPStoLL("Z 2222222 2222222")llCoord=converter.UTMUPStoLL("10 1234567 6543210")llCoord=converter.UTMUPStoLL({northPole, zoneNumber, easting, northing})varutmCoord=converter.USNGtoUTM(zone,letter,sq1,sq2,east,north,ret);varllCoord=converter.USNGtoLL(usngStr_input,getCenter);varmgrsCoord=converter.LLtoMGRS(lat,lon,precision);

CLI Test Tool Usage

Note: This is not for production use

Run with:usng-cli [function] [params]

In development you will need to runnpm link first.

Development

Build with:npm run buildFormat with:npm run format


[8]ページ先頭

©2009-2025 Movatter.jp