USNG: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
mNo edit summary
 
Line 14: Line 14:
     return usngc.LLtoUSNG(coord[1], coord[0], 5);
     return usngc.LLtoUSNG(coord[1], coord[0], 5);
  }
  }
[[Category: GIS]]

Latest revision as of 20:54, 11 March 2019

2019-03-11 I was shocked and dismayed when I realized today that I have never written a page with US National Grid information in it.

I think USNG is very elegant and does not get used because of the inertia of the inferior system of lat/lon and/or lon/lat coordinates.

JavaScript

import { transform } from 'ol/proj'
import usng from 'usng/usng'

let coord = [-123, 45]

let usngc = new usng.Converter();
let coordFormatter = (coord) => {
    return usngc.LLtoUSNG(coord[1], coord[0], 5);
}