preloadIcrfFixed Does not load Data

Hello! preloadIcrfFixed is not able to load iau2006XysData, is there an issue with setup? This is also run in a jest test if that makes any difference (I know we switched to native promises in cesium which could be a factor).
I used the following links as examples and below is the modified code, with some callstack notes.

// used this tutorial as a base for the time intervals / transformation (however promises have been updated)

// tried await, causes ungraceful termination

// Establish time end points
  var dateToCheck = cesium.JulianDate.fromIso8601("2001-03-21T12:00:00Z");
  var date2 = new cesium.JulianDate();
  cesium.JulianDate.addDays(dateToCheck, 3.0, date2);

  var date3 = new cesium.JulianDate();
  cesium.JulianDate.addDays(dateToCheck, 2.0, date3);

  // create time interval for
  var timeInterval = new cesium.TimeInterval({
    start : dateToCheck,
    stop : date2,
    isStartIncluded : true,
    isStopIncluded : false
  });

  cesium.Transforms.preloadIcrfFixed(timeInterval); // awaiting ungraceful error. could debug
  var pointInFixed = cesium.Cartesian3.fromDegrees(0.0, 0.0);
  var fixedToIcrf = cesium.Transforms.computeIcrfToFixedMatrix(date3); // returns undefined.
  var pointInInertial = new cesium.Cartesian3();
  if (cesium.defined(fixedToIcrf)) {
    pointInInertial = cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);
  }

// PreloadIcrf calls the following methods and xysFileUrlTemplate is undefined, as a potential issue.
//preloadIcrfFixed
//  Transforms.iau2006XysData.preload
//    requestXysChunk(this, 9)
//      if (defined(xysFileUrlTemplate)) { // false
      // chunkURL = _url: "http://localhost/static/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json",
//  And then when fixedToIcrf is called, computeXysRadians has an undefined sample, it sets isDataMissing to true and returns undefined.

Thank you for any help, please let me know if there’s anything i’m not setting up correctly. I also set the variable, CESIUM_BASE_URL = window.location.href, and also tried CESIUM_BASE_URL = ‘static/Cesium/’ but could be setting that incorrectly as well.

Hi @gardnedn, thanks for the question, sorry you’re having issues.

I would expect awaiting the call to preloadIcrfFixed to work fine as demonstrated in this sandcastle of your code.

I’m not as familiar with the inner workings of how Jest runs tests but given your last error message it seems the json file is not accessible from where that code is running. Trying to point it to the correct location may be the fix you need but I can’t say what that specifically is for your setup. Our quickstart guide does have some notes on where to point the base url which may help you.

1 Like