Mapping Pipelines from U.S. Government Data
Posted by clay_c on 17 April 2024 in English. Last updated on 3 October 2024.Pipelines are notoriously tough to map. They lie mostly underground, often with little to no visible trace on aerial imagery. What may look like a pipeline route on the ground may actually be a tangled bundle of pipelines, and even if we can figure out an individual pipeline’s true route, imagery tells us nothing about its name, who operates it, or what substance it carries.
Fortunately, the Pipeline and Hazardous Materials Safety Administration (PHMSA), an agency of the U.S. Department of Transportation, publishes authoritative, open data on pipeline routes. The NPMS Public Viewer, however, presents this data as raster images and limits how far you can zoom in. Despite this, we can use it quite effectively to identify pipelines and trace their precise routes.
Workflow
Requirements: JOSM, with Expert Mode enabled (this can be found at the bottom of the View menu).
Choose a county
There are over 3,000 county-equivalents in the United States. You may want to start with a place you’re familiar with, an unreviewed pipeline found on TIGERMap, or an area where you suspect data is missing from Open Infrastructure Map. Regardless, we’ll be focusing on mapping one county (or parish, borough, independent city, etc.) at a time.
Download the county’s pipelines
In JOSM, open the Download window ( Ctrl+Shift+Down ). Choose the “Download from Overpass API” tab along the top (if this is missing, make sure Expert Mode is enabled and try again). Paste the following into the query field:
{{geocodeArea:"Loving County, Texas"}};
way(area)[man_made=pipeline];
(._; >; <;);
out meta;
Replace Loving County, Texas
with the county-equivalent of your choice, and hit Download. Don’t worry about selecting a bounding box on the map; it will be ignored.
Now that you have a canvas to work with, you’re ready to get started mapping.
Open the county in PHMSA’s Public Viewer
Open the Public Viewer and enter your state and county. You’ll find two layers enabled by default: Gas Transmission Pipelines and Hazardous Liquid Pipelines.
Right-click on a pipeline and select a layer in the Identify menu. The pipeline becomes highlighted in yellow, and a box pops up with details about the pipeline, including name, operator and commodity (see substance=*
).
If your county has only a few pipelines, then this should be enough to work with. But if you encounter several pipelines tangled together, queries can help sort them out.
Untangle pipelines with queries
Click on Query Tools, then Query Pipelines. Pipelines can be queried based on various attributes, such as OPID (operator) or commodity. But for this exercise, we’ll be doing a spatial query. Near the bottom of the window, choose Draw an Area, and click the following button.
Find a cluster of pipelines, and click on the map to add corners of a polygon surrounding the bundle. Double-click to add your last point and finish.
Check the box for “Also display attributes in a table”, and hit OK. A new layer will appear on the map containing only the pipelines passing through the selected polygon, and a box will pop up with the details of each pipeline.
Select a row in the table, and then click the Highlight Selected Feature button below. The pipeline will show up yellow on the map.
Helpful Hints
Add as many imagery layers as possible in JOSM. Cycle through them with the ` key (above Tab ) as you map. You may find that one imagery source is good for a particular pipeline, but another source is better for a nearby pipeline (perhaps they were laid and photographed years apart).
It’s okay (and inevitable, really) to leave a pipeline unfinished. Just add fixme=continue
to the node at the end.
Click to copy coordinates with Javascript
With some Javascript trickery, you can trace a pipeline by copying and pasting coordinates over and over. To do this, add a new bookmark in your browser, give it a catchy name like “NPMS click to copy”, and paste the following as the URL:
javascript:(function()%7Bdocument.onclick%3Dfunction()%7Bnavigator.clipboard.writeText(document.getElementById('coordinates').textContent.substring(12))%3B%7D%7D)()
Clicking this bookmark while looking at the Public Viewer will make every subsequent click on the map copy the coordinates into your clipboard. This way, you can simply open the Add Node tool in JOSM ( Shift+D ), paste in the coordinates, and repeat until you’ve traced a pipeline.
If bookmarklets aren’t your thing, you can achieve the same effect by pasting this into your browser’s Javascript console:
document.onclick = function() {
navigator.clipboard.writeText(
document.getElementById('coordinates')
.textContent
.substring(12)
);
};
Discussion
Comment from stevea on 18 April 2024 at 00:04
This is awesome! Talk about a “project in a box,” this one has tasty tidbits and is wrapped in pretty paper. Presentable, prepare-able, proceed!
Comment from AntiCompositeNumber on 18 April 2024 at 00:17
I’ve found that scars from pipeline installation can be visible in USGS 3DEP data. Pipelines with a cleared cutline will be most visible, but less maintained pipelines are also often visible. I’ve even found long-distance buried telephone lines (according to old topo maps at least), but didn’t map those because I couldn’t confirm if they were still active.
Comment from stevea on 18 April 2024 at 03:40
Long-distance telephone lines generally stay put for as long as it is economically feasible to maintain them over their (century-estimated?) lifespan. Honestly, copper wire has served the planet well for 150 years of telephony. It isn’t going anywhere or “jumping out of the ground.” In places it might die quietly from lack of maintenance but it isn’t going to be actively dug up (frequently).
I love that “digging scars” can be seen in 3DEP data, neat-o!
Comment from IsStatenIsland on 3 May 2024 at 21:11
Lmao, when I first saw the pipeline map a few years ago I noticed how accurate it could be. The underlying data looked pristine despite the artificial limitations.
Maybe they were paranoid about “security” (or just did a front-end block to make someone happy or complete the requirements) or maybe they really don’t want to assume any responsibility for digging inquiries.