Hi Robert
Does it matter which line gets extended or do you want to extend both ends to that they meet in the middle?
Some pseudo code to get you thinking:
For each line in the table:
Get the start point from the line
1. Use a buffer around the start point to find neighboring lines within a distance larger than 0 but smaller than tolerance and with the same road name sorted by distance
2. Fetch the first neighbor (which will be the nearest)
3. Move the start point to the nearest point on the neighbor line
Get the end point from the line
1. Use a buffer around the start point to find neighboring lines within a distance larger than 0 but smaller than tolerance and with the same road name sorted by distance
2. Fetch the first neighbor (which will be the nearest)
3. Move the end point to the nearest point on the neighbor line
You basically repeat the same for the start and end points of each line.
This solution will just extend the first line found to it's neighboring lines.
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------