@esri/proj-codes
Version:
Get WKT and other metadata associated with an Esri/EPSG factory code.
31 lines (23 loc) • 727 B
JavaScript
const test = require('tape')
const codes = require('../')
test('lookup project codes', function (t) {
t.plan(6)
// projected codes
let proj = codes.lookup(3857)
t.equal(proj.name, 'WGS_1984_Web_Mercator_Auxiliary_Sphere')
// geographic codes
proj = codes.lookup(3819)
t.equal(proj.name, 'GCS_HD1909')
// vertical codes
proj = codes.lookup(3855)
t.equal(proj.name, 'EGM2008_height')
// undefined proj code
proj = codes.lookup(3333333)
t.equal(proj, undefined)
// just the name
let name = codes.lookup('3857').name
t.equal(name, 'WGS_1984_Web_Mercator_Auxiliary_Sphere')
// try the old one
name = codes.lookup('102100').name
t.equal(name, 'WGS_1984_Web_Mercator_Auxiliary_Sphere')
})