In the last post we discussed pros and cons of event- and feature-based implementations of the APDM. Here, in the last post of this series, we concentrate on actually loading features (facilities data, etc.) into the geodatabase.

As with our initial example, assume that we already have some facilities data (valves) stored in a simple feature class, without measure/station information:

Note the valves don’t fall exactly on the centerline. This is a normal occurrence with real data; online features seldom fall exactly on the centerline.

Our initial task is to generate measure/station values for our valves. Recall that we have both continuous and engineering station series features in our geodatabase. Because continuous/engineering station series pairs are spatially identical, there’s no reason to locate our valves on both. So let’s restrict ourselves to just engineering station series. To do so, right-click on the StationSeries layer in the ArcMap Table of Contents window and select Properties from the context menu to open the Layer Properties window. Click the Definition Query tab, and click theQuery Builder button therein to open the Query Builder window:

Enter [RefMode] = ‘Engineering’ into the …WHERE: text box; press OK to close the Query Builder window; press OK again to close the Layer Properties window and apply the definition query to the StationSeries layer.

We’ll use the ArcToolbox –> Linear Referencing Tools –> Locate Features Along Routestool to generate measure/station values for our valves:

Select Raw Valves in the Input Features pull down; select StationSeries in the Input Route Featurespull down; select EventID in the Route Identifier Field pull down; Enter 5 (or a value appropriate to your data) into the Search Radius text input field; specify an appropriate location for the output table in the Output Event Table text input field, enter SeriesEventID in the output Route Identifier Field text input field, and enter StationValue into the output Measure Field text input field. Accept the defaults for the remaining check boxes and press the OK button. Our output RawValves_Events table looks like:

Our valve events need their own EventIDs, and they’ll also need RouteEventIDs, so add two new GUID fields to the RawValves_Events table named EventID and RouteEventID. Use the logic of “How to Generate GUIDs in ArcMap” to generate values for EventID.

To populate RouteEventID, we’ll resort to a little chicanery. Right-click on the RawValves_Events table in the ArcMap Table of Contents window and select Joins and Relates –> Join to open the Join Data window:

Select SeriesEventID from the Choose the field in this layer that the join will be based on pull down; select StationSeries in the Choose the table to join… pull down, and select EventID in the Choose the field in the table to base the join on pull down. Press the OK button to create the join. Open the RawValves_Events table and use the Field Calculatorto calculate RouteEventID =[StationSeries.ParentStationSeriesEventID]. Then remove the join from RawValves_Events. The RawValves_Events table now looks like:

Here’s the good news: If your implementation is event-based, simply use the Appendtool to append the records from RawValves_Events to the APDM Valve table, and you’re done! Since our example is feature-based, there’s one more step to complete prior to performing the append.

Use the ArcToolbox –> Linear Referencing Tools –> Make Route Event Layertool to display RawValves_Events records as features:

Select StationSeries in the Input Route Features pull down; select EventID in the Route Identifier Field pull down; Select RawValves_Events in the Input Event Table pull down; select SeriesEventID in the event table Route Identifier Field pull down; select POINT in the Event Type pull down; select StationValue in the Measure Field pull down, and specify RawValves_Events Layer in the Layer Name or Table View text input field. Press the OK button to create the route event layer:

Note that unlike the source features, the RawValves_Events Layer features fall exactly on the centerline.

Use the Append tool to load features from RawValves_Events Layer into the APDM Valve feature class:

Select RawValves_Events Layer in the Input Datasets pull down; select Valve in the Target Datasetpull down; select NO_TEST in the Schema Type pull down, and use these field mappings in the Field Map control:

• Target Field – Source Field

• EventID – EventID

• OriginEventID – EventID

• RouteEventID – RouteEventID

• Measure – StationValue

• SeriesEventID – SeriesEventID

• Station – StationValue

• InletDiameter – Diameter

• OutletDiameter – Diameter

• ValveFunction – Function

• ValveNumber – ValveNumber

• Press the OK button to load the APDM valve layer:

And that’s it! BINGO! We have event data! Loading linear features is nearly identical, except that in the Locate Features Along Routes tool both begin and end (or from and to) station fields are specified. (We’ll leave that as an exercise for the reader!)

Stay tuned! In our next series, we’ll examine options for implementing geometric networks.