045] How to Create Shortest Path Lines from Points to Lines (Chainage Tool)

Learn how to generate the shortest connecting segments between points and lines while automatically calculating chainage distances.

This tutorial explores the "Chainage - Connect Selected Points to Selected Lines" feature in Global Mapper. We cover the initial setup, attribute configurations such as offsets and start points, and the process of displaying results using custom labels for technical documentation.

Creating Shortest Path Lines Between Points and Lines

This function can be used to measure how far a specific point is from a river or road in a straight line, to determine the distance of an intersection from the start or end of a road, or to identify the best location when branching water and sewage pipelines.

Let's get started.


First, draw some points and lines on your screen.

Initial points and lines drawn in Global Mapper
img 1 : Initial points and lines drawn in Global Mapper

Running the Chainage Connection Tool

Select both the points and the lines.

Selecting Advanced Feature Creation Options from the right-click menu
img 2 : Selecting Advanced Feature Creation Options from the right-click menu

Right-click and select Advanced Feature Creation Options -> CHAINAGE - Connect Selected Points to Selected Lines with New Lines.

A settings window will appear.

Chainage Options dialog box for setting offset and start point
img 3 : Chainage Options dialog box for setting offset and start point

Understanding Chainage Offset and Start Options

A new attribute called CHAINAGE is added to the newly created line segments. This attribute indicates the distance from the starting or ending point of the original line to the intersection point where the new shortest line meets it. If you enter '50' here, 50 will be added to the CHAINAGE value. This is useful when you want to set a starting point at a specific distance from the actual start or end of a road.

Checking 'Start Chainage from End of Line Rather than Start' will generate the CHAINAGE value based on the end point of the line segment.

When you click OK:

Shortest lines generated connecting the points to the target lines
img 5 : Shortest lines generated connecting the points to the target lines

Yes, the shortest lines connecting the points and the main lines have been generated.

Displaying Chainage and Length Labels

Next, let's adjust the Labels to find out the distance of the intersection from the starting point and the length of the new line segments.

Vector Options and Custom Label Setup to display Chainage and Length
img 6 : Vector Options and Custom Label Setup to display Chainage and Length

Double-click the generated line layer to enter Vector Options.

Select the Labels tab -> select Use Custom Format String -> click Setup, then enter the following:

Chainage: %CHAINAGE%
Length: %LENGTH%
  

After entering this, click OK and Apply.

Final map display showing distance from start and segment length labels
img 7 : Final map display showing distance from start and segment length labels

Reviewing Chainage Results and Labels

The distance from the starting point (CHAINAGE) and the length of the line segment (LENGTH) are now displayed.

Now, go back and try creating the result again after giving about a 50-meter offset in the Chainage options, and compare the values.


That's all for today!

Continue Learning
Explore complete tutorial collections for CityEngine and Global Mapper.

Comments

Popular posts from this blog

029] How to Split Polygon Areas with Intersecting Lines in Global Mapper

[008] How to Understand CGA Rule Structure in CityEngine (Beginner Guide)

046] How to Create Parallel Offset Lines in Global Mapper