Follow Eagle

Get Blog Updates By Email

Your email:

Learn More about Eagle Software and Services

Pipeline GIS Softwaredescribe the image

Eagle Pipeline GIS Blog

Current Articles | RSS Feed RSS Feed

How to Calculate Pipeline Length in ArcMap

  
  
  

In the last post we learned how to generate GUIDs in ArcMap. Here we learn an equally important skill, how to calculate pipeline length in ArcMap.

PODS and the APDM are based on linear referencing. This is a fancy term for establishing a system of linear measurement along linear features. For pipelines, the system of linear measurement is typically just the actual footage of pipe in the ground. Pipeliners usually refer to this measurement system as 'stationing.'

In ArcMap, features with linear referencing store not only X and Y (and optionally Z) values at each vertex in the shape, but also an 'M' (or 'measure') value. The M values establish the system of linear measurement on the feature. For pipeliners, M values usually store stationing.

The cool thing about linear referencing is that you don't have to know the actual X/Y location of a pipeline feature to map it; if you know its M (or station) value, ArcMap is smart enough to place the feature on your pipeline. In this age of GPS, stationing as a means of locating features is less important than it once was. But stationing nonetheless remains important for government reporting requirements and operations in many pipeline companies.

This is all hunky-dory for transmission pipeliners, where stationing is ubiquitous. But many gathering system operators do not maintain stationing on their pipe, and this can make using PODS or the APDM a challenge. But no worries, it's relatively easy to establish linear referencing on pipelines that lack stationing. We'll tackle half the task in this post (calculating pipeline length) and the rest of the task in the next post (adding measure / station values to pipeline features).

So let's go. Any polyline map layer will do, but we'll start with our hypothetical pipeline map layer, Raw Pipelines:

Calculate pipeline length mxd.

Each feature in Raw Pipelines is uniquely identified by its LineName value. Before we can enable our pipelines for linear referencing, we need to add two more attributes, BeginMeasure and EndMeasure. (More on why in the next post.) Begin- and EndMeasure will store the starting and ending measure (or station) values for each pipeline feature. To add these attributes, first open the Raw Pipelines table document by right-clicking on the Raw Pipelines map layer and selecting the Open Attribute Table Context menu option. Once the Table document is open, select the Add Field menu option from the Table Options pull-down button:

Table Add Field menu option

This opens the Add Field window. In the Add Field window, Type "Begin Measure" in the Name text box and select Double from the Type pull down:

Define BeginMeasure field

Press the OK button to create the BeginMeasure field. Repeat these steps to add the EndMeasure field. Your table should look similar to this:

Raw Pipelines table with Begin- and EndMeasure fields

Use the Field Calculator to set the value of BeginMeasure to zero. (For a Field Calculator refresher, see the previous post.) To set the value of EndMeasure, right-click on the field header and select the Calculate Geometry option from the context menu to open the Calculate Geometry window. In the Property pull down, stick with the default value of Length. Select either the Use coordinate system of the data source or Use coordinate system of the data frame radio button. Select the desired units from the Units pull down:

Calculate Geometry tool

Press the OK button to calculate the values of EndMeasure. Our table now looks like this:

Raw Pipelines table with Begin- and EndMeasure calculated

Note that SHAPE_Length  EndMeasure. This results from calculating EndMeasure using the data frame projection rather than the native projection of Raw Pipelines. This is precisely why we calculate our own EndMeasure field, rather than simply using SHAPE_Length. With the Calculate Geometry tool we can specify any projection (via the data frame projection) and any units desired. Cool, huh? This comes in handy for folks who store data in a geographic coordinate system (X/Y units are decimal degrees) or in a UTM (X/Y units are meters).

This example also illustrates the importance of picking an appropriate projection for length calculations. The projection for Raw Pipelines is State Plane Texas South; we calculated EndMeasure using State Plane Texas South Central. Even this small difference produces noticeable variance in calculated length. Why? All projections distort either area, length, or direction, or some combination of these. The details of projection distortion are beyond the scope of this post; suffice it to say that if you use a state plane or UTM projection suitable to your data, you're generally OK.

The value stored the SHAPE column of our table is 'Polyline Z'. Our shapes store X, Y and Z values, but not M values. This makes us sad and lumpy! We know how to calculate pipeline length, but we still need to generate M values on our shapes so we can use them in the APDM or PODS ESRI Spatial. We'll learn how to do that in the next post. Until then, happy calculating!

Comments

Tracy, I really find your posts useful. Although you were working with a 3D shapefile, I assume the "EndMeasure" values you calculated in this example would be 2D distances projected to the specified state plane projection.
Posted @ Thursday, September 23, 2010 11:26 AM by Bruce
Bruce, I'm glad you are enjoying them! Your assumption is correct. Even though it's a 3D polyline, ArcMap is calculating 2D projected length. In some ways ArcMap is still only 2 1/2 D. 
 
If you have the 3D Analyst extension and a digital elevation model (DEM), you can calculate projected 3D length using the ArcToolbox --> 3D Analyst Tools --> Functional Surface --> Add Surface Information (at 10.0) or Surface Length (at 9.3.x) tool. And if you are starting with a 2D polyline, you can make it 3D using the Interpolate shape tool in the same toolbox.
Posted @ Thursday, September 23, 2010 12:51 PM by Tracy Thorleifson
Tracey, I was looking for a GIS tip in my GIS reference files, and ran across the email Nathan sent with the link to this blog in it. I wish I had done it sooner. This is very helpful, easy to read and understand. Keep it up.
Posted @ Wednesday, May 25, 2011 7:41 AM by Mike McDonald
Post Comment
Name
 *
Email
 *
Website (optional)
Comment
 *

Allowed tags: <a> link, <b> bold, <i> italics