051] How to Automatically Detect Site Boundaries in Global Mapper Path Profiles Using ChatGPT

Use exported coordinate data to automatically detect project site ranges in terrain profiles.

This tutorial demonstrates how to leverage raw X, Y coordinate data from Global Mapper CSV exports to help ChatGPT automatically identify and highlight project site boundaries on a cross-section graph, eliminating the need for manual range input.

Continuing from the last session, I had more conversations with ChatGPT. It really feels like talking to a human.

The Problem with Manual Site Range Input

In the previous post, I manually designated the "site" area. In other words:

Intersection of the profile line and the project site boundary in Global Mapper
img 1 : Intersection of the profile line and the project site boundary in Global Mapper

As shown in the image above, I manually identified the range where the cross-section line intersects with the project site boundary and input that range when ChatGPT generated the graph.

Using CSV Coordinate Data for Automation

However, looking at the contents of the exported CSV file for the path profile:

Path profile CSV data displayed in Windows Notepad showing coordinates
img 2 : Path profile CSV data displayed in Windows Notepad showing coordinates

It doesn't just contain distance and elevation; it includes the raw coordinate values (X, Y).


The Potential for Automation

When you export a path profile in CSV format, you have various options:

"Save Path to CSV File (XYZ, Distance, Slope)..."

Because coordinates and elevation values are included, we can infer a possibility here. If we provide both the path profile CSV data and the project site CSV data to ChatGPT at once, it should be able to identify the project range automatically without me having to tell it manually.


Exporting the Project Site Area as CSV

Recently, we learned how to add points, lines, and areas using CSV files. (Refer to 049] Global Mapper - Adding Points, Lines, and Areas using CSV files).

Now, let's export the project site as a CSV area file.

Right-click menu on the layer to access the Export Layer to New File option
img 3 : Right-click menu on the layer to access the Export Layer to New File option

Select the project site layer, right-click, and choose Layer - EXPORT - Export Layer(s) to New File...

When the layer selection window appears:

Selecting the specific area layer for export
img 4 : Selecting the specific 'area' layer for export

Select only the layer containing the project site area and click OK. When prompted to choose the export format, select CSV and click OK.


Configuring CSV Export Options

When the CSV Export Options window appears, configure it as follows:

Detailed CSV Export Options including Field Separator and WKT format
img 5 : Detailed CSV Export Options including Field Separator and WKT format

Set the Field Separator to "Semicolon" and check "Export Area and Line Features (Use WKT Coordinate Format)". This is crucial for ChatGPT to understand the geometry. Click OK to save the file.

(Note: From the next session, I will skip capturing previously explained processes and just describe them in text.)


Conversing with ChatGPT

Uploading CSV Files to ChatGPT

Now we have two files: the path profile CSV and the project site area CSV. It's time to talk to ChatGPT. Log in to ChatGPT and upload both files.

Uploading PathProfile.csv and Site.csv to the ChatGPT interface
img 6 : Uploading PathProfile.csv and Site.csv to the ChatGPT interface

I uploaded the project site and path profile files and requested a graph using the "Path Profile Instructions" I developed during our previous conversations (I've added several new features since then).

The Result?

Refined profile graph generated by ChatGPT with the site area shaded and min/max points marked
img 7 : Refined profile graph generated by ChatGPT with the site area shaded and min/max points marked

It successfully identified the boundaries and marked the highest and lowest points within the project area. I also added another feature.

Global Mapper view of a profile line crossing multiple sections of the site
img 8 : Global Mapper view of a profile line crossing multiple sections of the site

Automatically Identifying Multiple Site Intersections

I tried creating a cross-section line that enters and exits the project area multiple times, as shown above.

And the result?

Complex profile graph showing multiple site intersections (site 1, site 2) with elevation callouts
img 9 : Complex profile graph showing multiple site intersections (site 1, site 2) with elevation callouts

Brilliant! It correctly identified "site 1" and "site 2".

Final Thoughts

It’s not difficult at all. Try chatting with ChatGPT to create a profile that fits your unique needs and style.


That’s all for today!

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

Comments