Has GitHub stopped serving Gist links to Cesium?

Hello,

I am working through examples to learn Cesium. I put in the link to TomPed’s Gist example in Sandcastle while logged in to Cesium under my account and receive the error “Unable to GET gist from GitHub API. This could be due to too many requests from your IP. Try again in an hour or copy and paste the code from the gist: https://gist.github.com/”.

I can access Tom’s example when I put the link directly into a browser URL: https://gist.github.com/TomPed/f028e4d7b79711a325ef077c53307472

Any ideas? Perhaps with many people using Gist load calls in Sandcastle, the Sandcastle ip was flagged by Github as posting too many requests?

-Tom

Yeah sharing Sandcastles with GitHub gists was disabled a few years ago, and earlier this year the access token mechanism we used to use for this was deprecated by GitHub: https://github.com/CesiumGS/cesium/pull/8614.

Also, welcome to the Cesium community Tom! What kind of geospatial work/visualization are you working on?

Hello Omar,

I’m working on GeoJSON and JSON data being pulled in and shown on the map. However, I just can’t get the data example from Sandcastle to work with my node.js server. I am working in Sandcastle in “DataSources” on the “Custom DataSource” example showing world population. I think it’s an awesome example!!

I am trying to replicate the “year” buttons with the population by year but I can’t get the buttons to work. It will load one year of data automatically from my json file but I can’t see how to get buttons on the screen so I could jump through the data by year.

I tried trying to find the js library to import with the Chrome tools but there are a LOT of libraries listed, I had trouble tracing back what is needed to make buttons that automatically populate like the Sandcastle example. Frankly, I would rather animate the data changes and show the year as a display but JS programming is not my first skill….

So then I tried using Gist on Sandcastle so I could at least upload the JSON files I made to see if they were readable but have been unable to put files into the Sandcastle server. It’s frustrating, I’ve spent a lot of time on this and can’t get anywhere.

I’ve been using STK since the mid-1990’s so the math for quaternions, satellite orbit representation, etc. is a piece of cake for me but it’s the JavaScript that is the challenge. I’ve been trying to get the data to show on and off for two weeks now.

I want to animate the growth of COVID-19 cases over time based on WHO data since I had employees who flew in from far-flung parts of the world and were quarantined in late March, and customers/family/friends were curious about the risks in the areas where they were, so I thought Cesium would be a good tool to use for illustrating that.

I also am going to model Iridium orbits over 3D terrain so customers can see if their mobile trackers are shaded by the terrain real-time. Iridium has real problems with terrain blockage when low on the horizon. I thought the COVID-19 example would be a good chance to become familiar with Cesium.

Maybe we can work on illustrating COVID-19 changes by geography together? A lot of people would like to see that.

We also launched a new satellite communication product that we are currently selling for emergency communications (the Flare, which turns your cell phone to a satellite phone) so was hoping a beautiful, easy-to-understand visualization might not only enlighten people on the disease spread but as a fringe benefit show people what we can do with data!

-Tom

So getting the Sandcastle buttons to work in your own application is going to be a matter of setting up the buttons as HTML and styling them appropriately. You don’t really need any additional libraries.

Although if you’re not familiar with HTML/CSS or don’t want to spend your time on that, you could just develop the visualization completely in Sandcastle and share a full screen version with the “open in new window” button (and you can also iframe that to embed it on your own web page etc). Or you could use Cesium Stories, and have each slide contain one of your GeoJSON datasources that the user can flip between. This is a good guide on getting started with Stories:

Introduction to Cesium Stories – Cesium

Stories does support time dynamic data too, so if you happen to have time-dynamic KML (or CZML exported from STK) you could just drag it and drop it into Stories. This is how the visualizations on this blog were done:

Maybe we can work on illustrating COVID-19 changes by geography together? A lot of people would like to see that.

I do believe a lot of people would be interested in doing something like that! I think the easiest path for you might be to generate a KML/CZML with timestamps and have Cesium Stories take care of the rest. Alternatively, since we’ve just moved to this new forum, this might be a fun project to start a thread in the general category on as you work on it and see if others are interested in collaborating! Especially if you’ve already aggregated some data that you can share.

The Iridium satellite visualization would also be very cool - I recently saw one made with Cesium, but I don’t think it took into account terrain:

Thank you for the info. But how do I upload a file into Sandcastle now the Gist is not working? Can I import the Sandcastle example into Stories, where I can save files?

Thanks

-Tom

You can still use Sandcastle as before. The GitHub Gists allowed you to load JavaScript code into Sandcastle. You can copy/paste that code into Sandcastle now instead. When you click the “share” button you’ll get a long URL with that code embedded in the URL so you can reload it that way.

If you want to visualize your own data, upload it to Cesium ion. Then you can load it into Sandcastle, in Cesium Stories, or in a custom app as described in this guide:

OK I’ve got to be missing something.

I see how to download .html files that have the js embedded in it to a local drive.

However, there seems to be no other way to run it again in the Cesium Sandcastle tool unless I manually copy and paste it in a new file.

In Ion, I could not find any way to import the html file, either.

Running the local server, I can load files but I lose the ease of testing things in the Ion or Sandcastle tools. Also the examples in Sandcastle call a lot of js files that are not in the libraries provided when setting up Cesium locally.

I must be missing something……

-Tom

Sandcastle is meant to be an online testing environment. You are correct that there’s no way to import a project into it that I’m aware of, other than copying and pasting the JavaScript and HTML code.

Cesium ion is a platform for hosting your content. So you would need a client that pulls the data from ion, most commonly a CesiumJS app, that you can be running, either locally, on Sandcastle, or on your own website.

Have you tried setting up your app on Glitch like the getting started guide above shows? You should be able to copy any Sandcastle code from in your custom app. The only exception is the UI elements.

If you’re trying to accomplish a specific feature that you’re having trouble with, feel free to open a new forum thread with that question and we can take a look.