Skip to content

WSDOT-GIS/wsdot-route-utils

Repository files navigation

wsdot-route-utils

Utilities for working with Washington state route identifiers.

Node.js CI Unlicense badge npm version number npm download count node version

NPM Installation

Use the following command to install the module into your npm project.

npm install --save wsdot-route-utils

Sample

Load module

JavaScript

import { RouteDescription } from "wsdot-route-utils";

Get info about a route ID

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'