I used ChatGPT to get a quick and dirty protoype for an application that would make a map of each individual QSO from a given CZML map I had already created. All in all, it took ChatGPT and I about 20 minutes to come up with a prototype of an application that takes one of my CZML POTA maps, walks through it QSO by QSO, creates a label on the map with embedded QSO information and then dumps out a text encoded PNG image of the QSO on an OpenStreets map.
=======================draft notes, skip to next equals line till polished==============
Here's my first question to ChatGPT:
Can I write Javascript that positions and frames a Cesium Ion map based on data read in through a czml file?
I quicly followed that up with
Please write a method to zoom to any polyline defined in the czml file. Zoom to each polyline, wait three seconds, and then zoom to the next polyline in the order they are defined in the file.
Next, I asked for a single line at a time:
Please modify the method so that it makes only line that is zoomed to visible and hides all other polylines.
Realizing that because my lines are animated in the czml file, AND that I wanted to see all the lines first, I asked:
Write a method to move the time slider on the Cesium Viewer to the earliest time defined in the czml file please
Then, to get the entire map in view, I followed up with:
Modify that method so that it after it sets the slider to the earliest time, it updates the map view to reflect this and zooms the map to contain all czml data
I asked for a modification to the main portion of the script to first display all QSOs, and then zoom to each one:
Modify the dataSourcePromise.then block to first call setTimeToEarliestandZoom, then wait one second, then call zoomToPolylines
Realizing that I was making enough changes that I should be revision controlling, I asked ChatGPT to explain gists to me:
Can you please explain github gists to me? What are they for and how should I use them?
I did a bit more tutoring, asking ChatGPT to explain the concept of 'availabillity' in CZML. Then, armed with that information, I fed it my entire CZML map and asked:
The czml I'm working with follows. Please modify the setTimeToEarliestAndZoom method so that it uses the times defined in the 'show' blocks associated with each polyline.
The usual 'mistakes' were made by ChatGPT, but it fixed most of them when I asked. Here's an example:
==============================end of draft notes====================
The following code crashes. Why?
intervals.forEach(interval => {
console.log("operating on interval");
});
Keep in mind, this was code that ChatGPT wrote. It immediately replied with
Why This Happens
Cesium.TimeIntervalCollection
is a custom class designed by CesiumJS to handle time intervals. It does not inherit from JavaScript's Array
prototype, so methods like .forEach
, .map
, or .filter
are not available.
And I can't get to worked up about it, because I was just able to easily insert the formatted code above because ChatGPT wrote the html for me. Also? The AI provided a for loop implemntation fo the code I asked about.
You can see the map I started from here. It's the map for my recent Juan Bautista twofer POTA activation.
You can see the prototype app here in a Cesium Sandcastle page.
Here's a video of the application in action.
And here are the mapped QSOs that were output.
I'm, once again, happily surprised by the quality of code that ChatGPT can crank out.