Skip to main content

ChatGPT Prototyping of Ham Radio Mapping Applications

 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 quickly 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.



Usage notes:

I know my target screen is 1080x1920. I used the Ctrl+Shift+C debug window in Chrome to setup the map in Cesium Sandbox so that it has about the same ratio.

Here's the measurements for the screen ratio... roughly speaking




 and the calculations to get there

The dimensions for the center panel of the TouCans banner are 720x404.


Comments

Popular posts from this blog

The Valentine's Day Magnetic Monopole

There's an assymetry to the form of the two Maxwell's equations shown in picture 1.  While the divergence of the electric field is proportional to the electric charge density at a given point, the divergence of the magnetic field is equal to zero.  This is typically explained in the following way.  While we know that electrons, the fundamental electric charge carriers exist, evidence seems to indicate that magnetic monopoles, the particles that would carry magnetic 'charge', either don't exist, or, the energies required to create them are so high that they are exceedingly rare.  That doesn't stop us from looking for them though! Keeping with the theme of Fairbank[1] and his academic progeny over the semester break, today's post is about the discovery of a magnetic monopole candidate event by one of the Fairbank's graduate students, Blas Cabrera[2].  Cabrera was utilizing a loop type of magnetic monopole detector.  Its operation is in...

Cool Math Tricks: Deriving the Divergence, (Del or Nabla) into New (Cylindrical) Coordinate Systems

Now available as a Kindle ebook for 99 cents ! Get a spiffy ebook, and fund more physics The following is a pretty lengthy procedure, but converting the divergence, (nabla, del) operator between coordinate systems comes up pretty often. While there are tables for converting between common coordinate systems , there seem to be fewer explanations of the procedure for deriving the conversion, so here goes! What do we actually want? To convert the Cartesian nabla to the nabla for another coordinate system, say… cylindrical coordinates. What we’ll need: 1. The Cartesian Nabla: 2. A set of equations relating the Cartesian coordinates to cylindrical coordinates: 3. A set of equations relating the Cartesian basis vectors to the basis vectors of the new coordinate system: How to do it: Use the chain rule for differentiation to convert the derivatives with respect to the Cartesian variables to derivatives with respect to the cylindrical variables. The chain ...

More Cowbell! Record Production using Google Forms and Charts

First, the what : This article shows how to embed a new Google Form into any web page. To demonstrate ths, a chart and form that allow blog readers to control the recording levels of each instrument in Blue Oyster Cult's "(Don't Fear) The Reaper" is used. HTML code from the Google version of the form included on this page is shown and the parts that need to be modified are highlighted. Next, the why : Google recently released an e-mail form feature that allows users of Google Documents to create an e-mail a form that automatically places each user's input into an associated spreadsheet. As it turns out, with a little bit of work, the forms that are created by Google Docs can be embedded into any web page. Now, The Goods: Click on the instrument you want turned up, click the submit button and then refresh the page. Through the magic of Google Forms as soon as you click on submit and refresh this web page, the data chart will update immediately. Turn up the:...