Hi All,
I'm attempting to remove some segments (future construction) from various LRS layers using ArcPy, and I'm running into a stumbling block that I'd appreciate some help with.
Using the Overlay Events tool from the Linear Referencing toolbox gives me an overlay of the future construction layer and the layer they're to be removed from.
Then, using a select by attribute query, I can trim this down to just the segments that need to be deleted. These are the records where there are values for both the future construction and the layer that it needs to be removed from (where both records are not null).
I initially thought I could just use the Route IDs from these segments to then remove them from the other layer, but the problem is that the segment to be deleted is a shorter segment than the segment that it's being deleted from. In other words, I can't just remove Route XYZ from my layer because it would remove more than just the future construction segment.
You can see an example of this in the attached screenshots. The red segment needs to be removed from the blue polyline, but that route actually extends beyond the red segment (see the second image with that route selected).
I thought about using an erase and then recalculating the to/from measures, but was unsure if that would cause additional issues or breakages in segments.
Any thoughts or guidance is greatly appreciated! Anyone else done something similar?
@jbradley A few questions to clarify the use case:
Assumed situation:
If the above is correct:
Hi Ayan, that's all correct. I'm writing a Python script to automate the overlay and removal of future construction from a large batch of layers.
I am using the Overlay Events tool to identify the segments of future construction that need to be removed.
My hangup is just in how best to actually remove them. I am pretty new to working with LRS data, so I'm unsure how to approach.
Hello @jbradley ,
Could you clarify if you are wanting to remove (retire) the section of route that covers the future construction you want deleted? Or .. do you want to retire a section of a future construction event?
That will help us provide you with some guidance.
Clive
Hey Clive,
If I'm understanding you correctly, then you have it right. I want to remove the sections of Layer A/B/C/D that are coincident with the future construction layer. The end user will see a published Layer A/B/C/D that does not contain future construction.
Hi @jbradley Are you using Roads and Highways (Location Referencing) in an enterprise LRS, or the Linear Referencing toolbox on standalone feature classes?
I'll take a swing at this from just a linear referencing viewpoint. I'm going to assume we are talking about two events which then get run through Overlay Event (linear referencing)
| Separate Events | Route ID | From Measure | To Measure | Value | |
| Event A | ABC123 | 0 | 15 | Some Value | |
| Event B | ABC123 | 0 | 5 | Future Construction | |
| Overlay Events Table | Route ID | From Measure | To Measure | Event A Value | Event B Value |
| Record 1 | ABC123 | 0 | 5 | Some Value | Future Construction |
| Record 2 | ABC123 | 5 | 15 | Some Value | <null> |
The goal is to remove 'Future Construction' sections from Event A. The logic I'll follow is "If Overlay has a 'Future Construction' value, then drop those sections from a new vintage of Event A"
Then here is one method: (a) Filter the Overlay to records 'Event B Value is NULL'. Then (b) Dyn-Seg the filtered Overlay and use that to replace as the new vintage of Event A. (possible refinement would be to dissolve where adjacent records have the same Event A value)
Another method could be what you meant in the original post using erase, but I think this would be more work that the steps above. Method 2: (a) DynSeg the Overlay table. (b) Erase 'Future Construction' segments from Event A. (c) Recalculate From/To Measures from the Event A polyline vertices.
Caveat: If we are talking about Roads and Highways Location Referencing, I would suggest a different set of steps.