Linear Referencing \ Create Routes:

3075
3
11-10-2010 11:46 AM
MarkEnglish
New Contributor II
I have a line feature class in which I need to extract measurements based on a pre-existing point feature class.  So, for each point on the line, I need to find its measurement along the line.  I need to create measurements along the line using the Create Routes tool.  My data is in a Lambert projection (feet), although I need for the point measurements along the line to be captured in decimal degrees.

Also, I am using stream data, which flows from all directions.  I used the Create Routes tool to quality assess the direction 0 to 1234, and noticed many of the streams were calculating distance from the wrong end.  Is there a way to automate this process potentially through elevation, or possibly another means?

Thanks in advance for your time!
0 Kudos
3 Replies
RichardFairhurst
MVP Honored Contributor
I have a line feature class in which I need to extract measurements based on a pre-existing point feature class.  So, for each point on the line, I need to find its measurement along the line.  I need to create measurements along the line using the Create Routes tool.  My data is in a Lambert projection (feet), although I need for the point measurements along the line to be captured in decimal degrees.

Also, I am using stream data, which flows from all directions.  I used the Create Routes tool to quality assess the direction 0 to 1234, and noticed many of the streams were calculating distance from the wrong end.  Is there a way to automate this process potentially through elevation, or possibly another means?

Thanks in advance for your time!


Linear Reference Measure values cannot be expressed as two numeric values, and I am unaware of any way to use decimal degrees that is expressed through a single numeric value.  Latitide and Longitude cannot be boiled down to a single number and the distance covered by a degree of Latitude is different from the distance covered by a degree of Longitude so movement in both directions cannot be expressed in a single decimal degree value to my knowledge.  Your measures can be in any linear units that are not dependent on a specific spatial plane of movement, such as feet, meters, time, etc.  You can, however, convert any resulting event point you create along your line to the appropriate Decimal Degrees pair of values with the approriate projection manipulation, but that is a separate process from setting or getting events along the line with a measure value (which is what Linear referencing is all about).

If I were trying to get the routes to build in the appropriate orientation and the lines are digitized to match the direction of flow I would calculate the From and To X and Y coordinates of the Routes into fields.  Then I would build a model.  In the model I would use SQL to do 4 selections to find routes that were dgitized from the upper left, lower left, upper right, and lower right and pass each selection to the Create Route tool with the appropriate origen setting.  Then I would append the 4 Route outputs together in the model.

The SQL for upper left Routes would be something like the following (this selection logic assumes that your local coordinates do not include both positive and negative values in a single plane of movement):

(ABS([FromX]-[ToX]) >= ABS([FromY]-[ToY]) AND [FromX] < [ToX]) OR (ABS([FromX]-[ToX]) < ABS([FromY]-[ToY]) AND [FromY] < [ToY])
0 Kudos
RichardFairhurst
MVP Honored Contributor
After thinking about the second part of my post I realized that your original features are likely to be broken into many segments and that any given segment will not necessarily be oriented the same as all of the others that build a Route.  Establishing orientation can be disorienting, but it can be done.

I like the approach or building the routes intially from any of the directions.  I would still calculate the From and To X and Y of the original lines.  But after that I would do a Locate Features Along Routes for the lines (with a small tolerance).  The output table can now be used to create a sequencing of the lines. You can use Chris Snyders Permananly Sort Feature tool in my post within this thread to get the features ordered in a way that will help create the sequences (sort on Route Id and the From Measure).  This can help you find your origen feature for the route which will help define the origen point to use to build the routes.  You can also export the events to features and calculate the new From and To X and Y of the lines to determine if they flipped.

With this information you can calculate a new field to your original features that represents the origen direction that should be used.  (It involves joins, various selections and field calculations to fill in the field). Then you can use that value to do the 4 selections and build your 4 sets of routes that will append together.  I have done this approach to handle a similar need to control orientation of the original features relative to the routes.  It worked although I would not necessarily call it an easy process. 

In my case I did not have a flow direction (my network is bidirectional roads), so getting connectivity correct was my sole consideration.  In your case, you may have to build some routes manually, since some streams may not choose the headwater origen feature no matter what origen point you pick using the automated tools.

Here is a VBA Field Calculation that is helpful for determining if your route features are simple or complex.  A value of 1 indicates you have a simple route with always increasing measures.  All other values indicate complex routes (branched routes or loops in most cases).

Dim Output As Long
Dim l As Long
Dim pCurve As ICurve
Dim pSegmentCollection As IMSegmentation3
Set pCurve = [Shape]
Set pSegmentCollection = pCurve
Output = pSegmentCollection.MMonotonicity
0 Kudos
EricAnderson
New Contributor II
I've chosen this way to get the proper Upper/Lower Left/Right start origin for creating a route.

  • Get envelope of each route

  • Get digitized start points for each route

  • Make points from envelope vertices

  • Calculate MIn/Max for X and Y from the envelope verticie points (for each route)

  • Test where Start Point falls in the Min/Maxs for X and Y (is StartX > (X2-X1)/2 or <? etc)

  • From tests determine Upper/Lower Left/Right quadrant

  • Feed quadrant into Create Routes

Digitized ditection drives where the start point is.

Eric
0 Kudos