Orbital Predictor for Earth Observation - API Orbit Example

This post shows how to use the orbital predictor API to predict the orbit of a satellite and display it in your own Glitch application using Cesium.js.
First step is to generate the czml file which contains the satellites future positions. This is done by making a call to the API.

Generate CZML

There are two types of API requests on orbital predictor: orbit and overpass.
The orbit API request takes one or more satellite ID's, and a date range, and returns czml data containing the satellites position over that range.
You can then use that data with Cesium.js to visualize the satellites orbit around a 3D globe.

For example, to predict the orbit of the International Space Staion (NORAD ID: 25544) for the next 24 hours, the API call would be:

http://www.orbitalpredictor.com/api/predict_orbit/?sats=25544&start=2017-12-22_00:00:00&end=2017-12-23_00:00:00&format=czml&type=orbit

Paste the above link into a new tab on your browser and save the content into a file called orbit.czml.

Visualise Orbit

Next we get Cesium.js to display the satellites orbit. To do this we'll use a basic Glitch app I've created which already has the 3D globe imported.
Follow the link below and click the "Remix this" button in the top left area of the page to create your own version.

https://glitch.com/edit/#!/cesium-hello-world

Then add a file to the app by clicking the "New File" button on the left of the page, give it the name "public/ISS.czml", and paste the contents of orbit.czml into it.
Then switch to the views/index.html file and paste the following code below the creation of the viewer on line 26:

var dataSrc = Cesium.CzmlDataSource.load("ISS.czml"); viewer.dataSources.add(dataSrc);

Finally click the "Show Live" button at the top of the screen to see your very own web app displaying the ISS's orbit.

Things to watch out for:

  • If the globe doesn't appear, you might have to update the version number of Cesium in the script and style imports on lines 12, 13 and 14.
    Check the latest version number of cesium at the following link:
    https://cesiumjs.org/downloads/

  • Glitch places a limit on file sizes and won't save the czml file if it's too large. If this happens, reduce the number of satellites and/or narrow the date range in the API call and try again.

Next Step

Once you have this working, you can change the date range or add more satellites to the request, for example, to view all of the European Space Agencies Sentinel satellites, including the newly launched Sentinel-5p, use the following request:

http://www.orbitalpredictor.com/api/predict_orbit/?sats=39634,41456,40697,41335,42969&start=2017-10-20_00:00:00&end=2017-10-20_06:00:00&format=czml&type=orbit

For a full list of list of satellites available on the API, go to:
http://www.orbitalpredictor.com/satellite_list/

In the next post I will give an example of using the API to predict an overpass.

Comments

  1. can you share the code, please?

    ReplyDelete
  2. can you share the code, please?

    ReplyDelete
  3. very excellent.i learnt much from your blogs. Thanks for your sharing.

    ReplyDelete

Post a Comment

Popular Posts