050] How to Create Advanced Terrain Profiles from Global Mapper Using ChatGPT
Export raw elevation data from Global Mapper to CSV and use ChatGPT to generate professional, high-fidelity terrain cross-sections.
This tutorial demonstrates how to overcome the visual limitations of built-in GIS profile tools. By leveraging AI-driven Python scripting, you can create custom-shaded site areas, highlight steep slopes, and add precise leader-line annotations to your terrain analysis reports.
Exporting Path Profile Data from Global Mapper
Today, I’d like to share an experimental workflow for improving terrain profile visualization in Global Mapper.
First, please run Global Mapper.
With the DEM created, add a line segment. Now, let's extract the terrain profile.
After selecting the line segment, right-click and select Analysis/Measurement - Path PROFILE.
The Path Profile result window will appear.
As you can see, the default profile visualization is fairly minimal. While it's functional enough to convey information, So I explored whether ChatGPT could be used to generate a cleaner and more presentation-ready terrain profile.
Saving Terrain Profile Data as CSV
To do this, save the results as a CSV file.
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.
Enter a name and save it. Now, let's check the file in Notepad.
Using ChatGPT to Generate Terrain Cross-Sections
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.
Custom Path Profile Guidelines for ChatGPT
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:
Custom Path Profile Guidelines for ChatGPT
1. Terrain Profile Graph Configuration
- X-axis: Distance (Total)
- Y-axis: Elevation Elevation
- curve:
Solid black line Graph
- title: Do not display
2. Removing Default Slope Indicators
- Do not represent any lines or markings related to Slope.
3. Highlighting the Project 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. Adding Elevation Labels with Leader Lines
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. Configuring Distance and Elevation Axes
- 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. Final Visualization and Export Settings
- Do not use a legend. Enable grid lines. Save format: PNG (convert to PDF if necessary).
Generating Refined Terrain Profiles with ChatGPT
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:
Looks clean, right? Now, I will set the project site range from 400m to 900m and redraw the graph.
And the result?
Following the guidelines, the project site is shaded, and the sea-level elevation at the boundaries is displayed. Let's try one more thing.
Highlighting Steep Slopes in Terrain Profiles
I'll mark areas within the site where the slope is 15 degrees or more with a red line.
And the result?
Why This Workflow Improves GIS Visualization
It rendered it perfectly. You can also adjust font size, grid intervals, and colors.
Because this workflow was refined through repeated interactions with ChatGPT, your results may vary depending on how detailed your instructions are. 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. Once the DEM is exported as XYZ or CSV data, the visualization possibilities become highly flexible. With properly structured prompts, ChatGPT can generate customized terrain analyses far beyond the default capabilities of Global Mapper. I'll have to try that when I have time.
That's all for today!
- Learn previous workflow in [049] Adding Points, Lines, and Polygons using CSV Files
Comments
Post a Comment
Feel free to leave a comment if you have any questions about Global Mapper or CityEngine. I will get back to you with a sincere response as soon as possible. (Please note that all comments are moderated and manually approved to maintain a high-quality community. Promotional or spam content will not be published.)