Skip to content

mtepenner/iss-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

ISS Tracker & Geocoder

A lightweight C++ command-line tool that tracks the real-time location of the International Space Station (ISS) and translates its coordinates into a human-readable geographic location.

The application works by querying the Open-Notify API for the station's current latitude and longitude, and then utilizing the OpenStreetMap Nominatim API to reverse-geocode those coordinates into a specific city, country, or region.

Features

  • Real-Time Tracking: Fetches live coordinates of the ISS using the Open-Notify API.
  • Reverse Geocoding: Converts raw latitude and longitude data into human-readable locations using OpenStreetMap.
  • Ocean/Unmapped Handling: Gracefully handles edge cases where the ISS is passing over oceans or unmapped territories.
  • JSON Parsing: Utilizes nlohmann/json for efficient JSON response handling.

Prerequisites

To build and run this project, you will need a C++ compiler (supporting C++11 or later) and the following libraries:

  • libcurl: Used to handle HTTP GET requests.
  • nlohmann/json: A robust, single-header C++ JSON library.

Installation & Build Instructions

On Ubuntu/Debian Linux

  1. Install the required dependencies:
    sudo apt-get update
    sudo apt-get install libcurl4-openssl-dev nlohmann-json3-dev
  2. Compile the source code:
    g++ -o iss_tracker iss_tracker.cpp -lcurl

On macOS (Using Homebrew)

  1. Install the dependencies:
    brew install curl nlohmann-json
  2. Compile the source code:
    g++ -std=c++11 -o iss_tracker iss_tracker.cpp -lcurl -I/opt/homebrew/include

Usage

Run the compiled executable from your terminal:

./iss_tracker

Example Output (Over Land)

Fetching real-time ISS coordinates...
ISS is currently at -> Latitude: 46.2276, Longitude: 2.2137
Determining location on Earth...

Result: The ISS is currently passing over:
France, Metropolitan France

Example Output (Over Ocean)

Fetching real-time ISS coordinates...
ISS is currently at -> Latitude: -12.4563, Longitude: -130.8752
Determining location on Earth...

Result: The ISS is currently over an ocean or an unmapped region.

Important Notes & API Limits

  • Oceanic Coverage: Approximately 71% of the Earth's surface is covered by water. If the ISS is over an ocean, the OpenStreetMap API will usually return an error indicating no address was found. The code catches this and alerts the user accordingly.
  • Rate Limiting: This application utilizes the free OpenStreetMap Nominatim API. Their usage policy strictly limits requests to a maximum of 1 request per second. If you intend to modify this code to run in a continuous loop, ensure you implement a sleep() command to respect this rate limit and prevent your IP from being temporarily blocked.

Built With

About

A C++ command-line application that tracks the real-time coordinates of the International Space Station (ISS) and uses reverse geocoding to determine its current location over Earth.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages