BY G2 INTEGRATED SOLUTIONS

In the last post we learned about the APDM / PODS ESRI Spatial StationSeries feature class and its unique characteristics. When last we left our hypothetical Raw Ripelines feature class (see How to Add Measure / Station Values to Pipelines in ArcMap), we had converted it into a Raw Pipeline Routes feature class sporting measure values based on calculated pipeline length. Here we learn how to load our Raw Pipeline Routes into the StationSeries feature class in a PODS ESRI Spatial 5 or APDM 5 geodatabase.

The ArcToolbox Create Routestool regrettably left our Raw Pipeline Routes bereft of attribution beyond LineName, so we’ll have to re-add Begin- and EndMeasure. And we need more. So let’s add fields, the following being the minimum required to support loading (in addition to LineName):

• Field name, type, {length} – target field in the StationSeries feature class

• LineGUID, GUID – LineLoopEventID (In the next post, we’ll use it to populate EventID in the LineLoop table.)

• ContinuousGUID, GUID – EventID/OriginEventID for continuous type station series (These values will also appear as ParentStationSeriesEventID values for engineering station series.)

• EngineeringGUID, GUID – EventID/OriginEventID for engineering type station series

• SeriesOrder, Long – SerieOrder for engineering station series

• EngineeringName, Text, 45 – StationSeriesName for engineering station series

• EngRefMode, Text, 20 – RefMode for engineering station series.

• ContRefMode, Text, 20 – RefMode for continuous station series.

• BeginMeasure, Double – BeginMeasure and BeginStation

• EndMeasure, Double – EndMeasure and EndStation

After adding these fields to Raw Pipeline Routes, we use the Field Calculatorto calculate values (and remember to click the Python radio button in the Parser control panel):

• Field – Expression

• SeriesOrder – 1000

• EngineeringName – !LineName! + ” – ” + str(!SeriesOrder!)

• EngRefMode – “Engineering”

• ContRefMode – “Continuous”

• BeginMeasure – 0

• EndMeasure – !Shape.lastPoint.M!

These expressions use Python syntax; those of you still using Arc 9.3.x will need to use the ArcToolbox Calculate Fieldtool instead of the Field Calculator. The EndMeasure expression illustrates the power of Python. Those of you familiar with VB script will note that obtaining ‘M’ values from features requires a VB pre-logic script code block. But with the ArcPy geometry object, you can access shape attributes in simple expressions. Speaking of Python, follow the logic of How to Generate GUIDs in ArcMapto create GUIDs for LineGUID, ContinuousGUID and EngineeringGUID. Following these machinations, our Raw Pipeline Routes table looks something like:

Recall that we need to load our Raw Pipeline Routes features twice, once as continuous station series, and again as engineering station series. We’ll start by loading continuous station series. We’ll use the ArcToolbox –> Data Management Tools –> General –> Appendtool to load our Raw Pipeline Routes into a target APDM 5 geodatabase. (I use an APDM 5 target because some of you may not be PODS members, and the centerline structure for APDM 5 and PODS ESRI Spatial 5 is identical. If your organization is not a PODS member, fix that!) To open the Append tool in ArcMap, open the ArcToolbox window by clicking on the ArcToolbox button on the Standard toolbar, navigate to the Append tool, and double-click it:

In the Append tool window, select Raw Pipeline Routes in the Input Datasets pull down; StationSeries in the Target Dataset pull down, and, most importantly, NO_TESTin the Schema Type pull down. The NO_TEST option lets us use the Field Mapcontrol panel to map source fields to target fields. Use the following field mappings for the continuous station series append:

• Target Field – Source Field

• EventID – ContinuousGUID

• OriginEventID – ContinuousGUID

• BeginMeasure – BeginMeasure

• EndMeasure – EndMeasure

• BeginStation – BeginMeasure

• EndStation – EndStation

• LineLoopEventID – LineGUID

• RefMode – ContRefMode

• StationSeriesName – LineName

• SeriesOrder – Nothing (delete automatic mapping to SeriesOrder)

Note that the Field Map control automatically maps source fields to target fields of the same name and data type. We don’t need SeriesOrder populated for continuous station series, so delete the automatic mapping. Press the OK button in the Append tool window to load our Raw Pipeline Routes as continuous station series. Perform the Append a second time to load Raw Pipeline Routes asengineering station series using these field mappings:

• Target Field – Source Field

• EventID – EngineeringGUID

• OriginEventID – EngineeringGUID

• BeginMeasure – BeginMeasure

• EndMeasure – EndMeasure

• BeginStation – BeginMeasure

• EndStation – EndMeasure

• LineLoopEventID – LineGUID

• ParentStationSeriesEventID – ContinuousGUID

• RefMode – EngRefMode

• StationSeriesName – EngineeringName

• SeriesOrder – SeriesOrder

And Voila! We’ve loaded the StationSeries feature class! YAY!If you do an Identify on a StationSeries feature in ArcMap, you should get two features:

Note that ArcMap automatically populates the GlobalID field for us – kinda cool!

We’re really eating biscuits, now, gentle reader. In the next post we’ll create a query table from Raw Pipeline Routes and append to the APDM/PODS ESRI Spatial LineLoop table.