wsdot-route-utils
v3.0.0
Published
Utilities for WA state route IDs
Downloads
48
Maintainers
Readme
wsdot-route-utils
Utilities for working with Washington state route identifiers.
Get from NPM
npm install --save wsdot-route-utils
Sample
Load module
JavaScript
ES5
let wsdotRouteUtils = require("wsdot-route-utils");
let RouteDescription = wsdotRouteUtils.RouteDescription;
ES2015
import { RouteDescription } from "wsdot-route-utils";
Get info about a route ID
const srid = "101COABERDN";
let desc = new RouteDescription(srid);
console.log(desc.sr); // '101'
console.log(desc.rrt); // 'CO'
console.log(desc.rrq); // 'ABERDN'
console.log(desc.rrtDescription); // 'Couplet'
console.log(desc.rrqDescription); // 'Aberdeen' (description may sometimes be just the same as `rrq`).
console.log(desc.mainlineConnectionMP); // null
console.log(desc.shield); // 'US'
const srid = "005R109958";
let desc = new RouteDescription(srid);
console.log(desc.sr); // '005'
console.log(desc.rrt); // 'R1'
console.log(desc.rrq); // '09958'
console.log(desc.rrtDescription); // 'Off Ramp, Dec'
console.log(desc.rrqDescription); // 'at milepost 99.58'
console.log(desc.mainlineConnectionMP); // 99.58
console.log(desc.shield); // 'IS'