050] Global Mapper - Refining Path Profile : with chatGPT

050] Global Mapper - Refining Path Profile : with chatGPT


Today, I’d like to share something I tried out of curiosity.

First, please run Global Mapper.

[img 1 : DEM created in Global Mapper with a line segment added for profile analysis]
[img 1 : DEM created in Global Mapper with a line segment added for profile analysis]

With the DEM created, add a line segment. Now, let's extract the terrain profile.

[img 2 : Accessing Path Profile through the Analysis/Measurement menu]
[img 2 : Accessing Path Profile through the Analysis/Measurement menu]

After selecting the line segment, right-click and select Analysis/Measurement - Path PROFILE.

The Path Profile result window will appear.

[img 3 : Standard Path Profile result window in Global Mapper]
[img 3 : Standard Path Profile result window in Global Mapper]

As you can see, it's quite basic. While it's functional enough to convey information, I thought about refining it using chatGPT.

To do this, save the results as a CSV file.

[img 4 : Selecting 'Save Path to CSV File' from the Path Profile File menu]

In the Path Profile window, go to File - Save Path to CSV File (XYZ, Distance, Slope).

A window asking for the save location will pop up.

[img 5 : Saving the terrain data as Terrain.csv]
[img 5 : Saving the terrain data as Terrain.csv]

Enter a name and save it. Now, let's check the file in Notepad.

[img 6 : CSV data viewed in Notepad showing coordinates, elevation, and distance]
[img 6 : CSV data viewed in Notepad showing coordinates, elevation, and distance]

Yes, it has been saved correctly. Now, log in to chatGPT (note: I am a paid user).

Upload the CSV file you just saved to the chat window and ask it to generate a graph.

[img 7 : Uploading the CSV to ChatGPT and requesting graph generation]
[img 7 : Uploading the CSV to ChatGPT and requesting graph generation]

The "Path Profile Guidelines" mentioned in the prompt are the following set of instructions that I "agreed" upon with chatGPT after considerable trial and error:

1. Basic Configuration

- X-axis: Distance (Total)
- Y-axis: Elevation Elevation
- curve: Solid black line Graph
- title: Do not display

2. Slope Related

- Do not represent any lines or markings related to Slope.

3. Site Area

Based on the user-specified distance interval (Site): Fill the area under the elevation line for that interval with black semi-transparent shading (alpha=0.3). The shading should extend down to the minimum elevation grid tick (grid_y_min). Place the Site label "site": Centered in the site interval (X-axis). In the upper space to avoid overlapping with the elevation curve and shading. Color: Black, Alignment: Horizontally centered, bottom aligned.

4. Elevation Text Display

Display the elevation values for the start and end points of the Site area using leader lines. Left (Start): Leader line pointing up-left / Right (End): Leader line pointing up-right. Text format: "XXX.X m", Color: Black.

5. Axis Settings

- X-axis label ("Distance (m)"): labelpad ≈ -2 Y-axis (Elevation): Display ticks at 20m intervals, starting from 20m below the minimum elevation to 20m above the maximum elevation. Fix the axis scale to 1:1 to prevent visual distortion.

6. Other Visual Settings

- Do not use a legend. Enable grid lines. Save format: PNG (convert to PDF if necessary).

I saved these instructions as a text file and added them to the project files so chatGPT could refer to them. Here is the result:

[img 8 : Cleanly rendered terrain profile generated by ChatGPT]
[img 8 : Cleanly rendered terrain profile generated by ChatGPT]

Looks clean, right? Now, I will set the project site range from 400m to 900m and redraw the graph.

[img 9 : Requesting ChatGPT to set the site range from 400-900m]
[img 9 : Requesting ChatGPT to set the site range from 400-900m]

And the result?

[img 10 : Profile with shaded site area and boundary elevation labels]
[img 10 : Profile with shaded site area and boundary elevation labels]

Following the guidelines, the project site is shaded, and the sea-level elevation at the boundaries is displayed. Let's try one more thing.

I'll mark areas within the site where the slope is 15 degrees or more with a red line.

[img 11 : Requesting ChatGPT to highlight slopes over 15 degrees in red]
[img 11 : Requesting ChatGPT to highlight slopes over 15 degrees in red]

And the result?

[img 12 : Final graph with site shading, elevation labels, and red lines for steep slopes]
[img 12 : Final graph with site shading, elevation labels, and red lines for steep slopes]

It rendered it perfectly. You can also adjust font size, grid intervals, and colors.

Since this is a result of learning between me and my chatGPT, you might not get the exact same result even if you use the guidelines I showed. You'll need to talk to it and "teach" it diligently.

Depending on how detailed you make your instructions with chatGPT, expressions not provided by Global Mapper are entirely possible. It seems that if you save the DEM in XYZ format and specify the project site area, you can perform any analysis to your liking. I'll have to try that when I have time.

That's all for today!

Comments

Popular posts from this blog

001] Global Mapper - Creating DEMs

009] Global Mapper - Visibility Frequency Analysis

003] Global Mapper - Terrain Analysis, DEM Creation, and Raster Reclassification