Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

How To Live Track The ISS International Space Station

How To Live Track The ISS International Space Station

Our Winter Webinars series has been a lot of fun, showing you how to write genuine low-code cross-platform apps that do cool things with a few lines of code and get them to work on Windows, macOS, iOS, Android, and Linux. I know from your emails and messages you’ve had as much fun with the Winter Webinars as I have had. I’ve tried to make them a lot less like old-fashioned lectures and instead aim for a much more relaxed feeling. Coding and tech should be enjoyable, shouldn’t it? Well, I think so – and I’ve been a software developer for over forty years now and I still love every minute of it. The most recent webinar really harnessed my personal joie de vivre for geeky tech when, among other things, I wrote a fully working app that can automatically live-track the International Space Station, a.k.a. The ISS. in around 10 – 20 lines of code. It’s an awesome demonstration of the power of RAD Studio and Delphi, along with a little help from one of our tech partners, TMS Software and their FNC Maps component.

What did I use to automatically track the ISS International Space Station?

First, I found a really superb site which listed a whole ton of free REST APIs. The site is www.freepublicapist.com – and it contains over 350 APIs which you can easily use in your Delphi and C++Builder apps.

One of those APIs returns the current location of the ISS as a JSON packet containing the longitude and latitude of its current location. It doesn’t require any authentication and the only limitation is they ask you do not make a call to the API more frequently than every 5 seconds. So, let’s open RAD Studio and then run the REST Debugger and see if we can make it work! Select, Tools and then REST Debugger from the main RAD Studio menu.

This will open the main REST Debugger menu. It’s a very handy tool and has some nifty magic too.

The ISS API shows the following endpoint:

So let’s put that in the REST Debugger and send a test request.

…after a short pause we get back a response from the API. Nice!

So, this is showing us it worked and that the result has a JSON array called “iss_position“. This contains two elements: latitude and longitude – in other words, the GPS position of the ISS relative the Earth. The timestamp lets us know the exact time of this location. This is useful since the ISS is traveling at the equivalent of 17,500 miles an hour. At that speed even a few hundreds of a second delay in transmitting the GPS coordinates would mean the ISS is no longer at exactly that point. Dealing with the physics and math of spacecraft is a weird thing. Don’t get me started on the freakishness of time dilation.

How to create an app which tracks the ISS in real time?

Well, first we need to create a new Windows VCL or FMX cross platform app. I have some example code with a RAD Studio project listed at the bottom of this article which contains complete, working VCL, FireMonkey FMX, and a TMS WEB Core apps that all track the International Space Station and plot it on a map.

One of the features of the REST Debugger is that once you have got the API endpoint working it has a button which automatically creates the necessary REST Client and Response components for you and then copies them to the clipboard.

You then just go to your app’s main form and hit paste. The necessary REST components will magically appear. You don’t get much more low code than that.

What mapping component was used for the ISS tracking app?

There are a few different mapping components around but I selected the TMS FNC Maps component. It works on all platforms and all frameworks: VCL, FireMonkey FMX, and WEB Core.

It’s a very slick component and very easy to use – I like easy, I’m lazy. 😁

What mapping service did you use for the ISS tracking app?

The TMS FNC maps works with pretty much all the mapping services which is another reason I chose it. The actual mapping service I used was OpenLayers. This is a wonderful mapping service that is completely free to use. I’ve found OpenLayers to be completely reliable and it requires absolutely no setup or authentication at all – you use select it and use it, as simple as that.

How much code was used in the ISS tracking app?

In total, not including the form class definition interface, fewer than 100 lines of code. This is Delphi, we’ve been doing ‘low code’ as our thing for nearly 30 years!

Where can I see the replay of the webinar where the ISS tracking app is created?

Here is the full replay. The ISS demo is around the 46 minute mark.

Where can I get the code for the ISS live tracking app?

You can find the full Delphi code for the VCL, FireMonkey FMX and TMS WEB Core apps here: https://github.com/checkdigits/iss_demo

NOTE that you must install the TMS FNC Maps component to open any of the projects in the project group. You will also need to install TMS WEB Core if you want to try out the ISS automatic tracking app as a web page, TMS do trial versions of their components – the app will work with them.


If you want to try out the project and you don’t have a copy of the latest version of RAD Studio with Delphi, you can go to the products page and download a free fully working trial version.

Exit mobile version