Hello everyone,
I have a .csv file that contains the time signature, coordinates and GPS altitude of an aircraft every second throughout its flight. I would like to import this data into a cesium.js script file and construct a path entity rather than putting it into a CZML file and loading the data source.
So far, I'm able to import the text file in the necessary data format (ISO8601 time, latitude, longitude, altitude), from which I add as a sampled position property to a variable called 'pos'. I then use this variable as the position property of an entity I create in the viewer.
Here's the code which will more easily explain it:
Just a guess here - do you need to set Cesium’s clock to be within the time interval?
I at least need the clock to start at the time the flight starts. Each data point has a time signature associated with it and the first point exists at the time I started the Cesium clock.
Right now I'm thinking that the problem might lie within the position property of the entity. I've had problems before with syntax errors of certain properties that require arrays that don't show up as errors in the console, rather, the object just won't be created.
In case this might be the issue, here's the format of my position data file:
2017-01-02T19:05:45Z,33.3128700,-111.6707916,1244.4
2017-01-02T19:05:46Z,33.3128700,-111.6707916,1244.4
2017-01-02T19:05:46Z,33.3128700,-111.6707916,1243.3
2017-01-02T19:05:47Z,33.3128700,-111.6707916,1243.0
etc... for 8114 more lines...
Might anyone see an error in this?
Ok, two things I see that are possibly wrong with this data now that I've posted it.
1. I forgot to include a comma at the end of the line which means when I split the data upon importing it, the GPS Alt and the ISO8601 time get grouped in the same index.
Solution: add a comma at the end of the line.
2. There are technically new line characters ('\n') after the last comma. I don't think these are ignored and get grouped in the same index as the time which might F things up when it comes to translating the position data in Cesium.
Solution: ... anyone?