Utilities for working with Washington state route identifiers.
Use the following command to install the module into your npm project.
npm install --save wsdot-route-utils
import { RouteDescription } from "wsdot-route-utils";
const srid = "101COABERDN";
const 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";
const 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'