4/18/2025
Last week I attended my first AASHTO GIS-T conference in Portland OR. GIS is already a small profession and this was specifically for GIS in Transportation, an even smaller subset of the community. Most who attended the conference worked for a state DOT or a consultant who works for those DOTs. I met many people whose sole focus is Linear Referencing Systems, often called LRS. Doing GIS for over 20 years, I have only dabbled a little bit in LRS so it peaked my interest in this niche subset of my industry.
Instead of using XY to locate things, linear referencing locates things in relation to a network, such as roads, pipelines or river networks. It measures the distance down a line segment of a network and optionally an offset distance from the line segment (left side or right side). As an example, you could say, the traffic sign is located 50 feet from the beginning of Smith Street and it is offset to the right by 10 feet, this helps a field worker find the traffic sign by measuring from the beginning of Smith Street without the need for a GPS.
It is a rather unconventional way to locate things in our modern GPS enabled world. LRS has a few pros and cons as to why or why not use it. One of the pros is dynamic segmentation to store many features within one line segment geometry. At the conference the buzzword, conflation, was used frequently and I had to look up the definition.
This got me thinking of one of my favorite JS libraries, Turf.js. This library does geospatial analysis quickly in a web browser with GeoJSON data. Turf has a few methods for working with line data, so I thought it would be cool to recreate some LRS functionality with it. My example below queries PennDOT's RMS data and returns the state route segment, the measure from the start of the segment, and the offset distance from the segment.
Drag & Drop Pin near a PA State Route.
All the work is done with three Turf methods, turf.nearestPointOnLine, turf.lineSlice, and turf.length. With these and a few other methods, you can do pretty much any LRS operation right on the web and super fast. I would encourage any LRS expert to look at Turf.js to see if it is right for your project or tool. GIS doesn't need to be hard, slow, or inaccessible and that is why I like Turf.