In order to understand how a CZML file is organized, please check the [tutorial](Tutorial).
# Prerequisities
*[Java](https://www.java.com/fr/) 8 or more
*[Orekit](https://gitlab.orekit.org/orekit/orekit) >= V 1.12
...
...
@@ -10,93 +14,8 @@
* A directory and a path of the inputs if there are some.
* A directory and a path of the output.
## CZML Structure
In order to understand how a CZML file is organized, please check the [tutorial](Tutorial).
## Usage
### How to build your CZML file
* With an OEM file
You will need first to build an OEMFile object with a given path
```
OEMFile oemFile = new OEMFile(inputPath);
```
You will then be able to build the header of your CZML file and to write it
```
Header headerOEM = oemFile.getHeader();
headerOEM.write();
```
If you want to see a satellite you can then build a Sattelite Object, write it and end the file
```
Satellite satelliteCZML = new Satellite(oemFile,header);
satelliteCZML.write();
satelliteCZML.endFile();
```
Finally you create your output file with a path and the path with the name of your file
```
CZMLFile CZMLfile = new CZMLFile(pathName,outputPath);
CZMLFile.write(headerOEM);
CZMLFile.write(satelliteCZML);
```
* With a list of Orekit SpacecraftStates
It is the same method : Creation of a header, write it, creation of a satellite, write it.
You will just need to create a SpacecraftStateListInput object
```
// Object
SpacecraftStateListInput input = new SpacecraftStateListInput(spacecraftStateList);
// Header
Header header = input.getHeader();
header.write();
// Satellite
Satellite satelliteSpacecraftStates = new Satellite(input,header);
satelliteSpacecraftStates.write();
satelliteSpacecraftStates.endFile();
// Output File
CZMLFile CZMLfile = new CZMLFile(pathName,outputPath);
CZMLFile.write(header);
CZMLFile.write(satelliteSpacecraftStates);
```
* With an Orekit Orbit
You will need to first create an Orekit Orbit, then to create an OrbitInput object.
You will then need to enter the Type of Orbit with the Orekit OrbitType (here KEPLERIAN is used), and the timescale supported is UTC.
```
// Object
OrbitInput orbitInput = new OrbitInput(orbit, OrbitType.KEPLERIAN,UTC);
// Header
Header header = orbitInput.getHeader();
header.write();
// Satellite
Satellite satelliteOrbit = new Satellite(orbitInput,header);
satelliteOrbit.write();
satelliteOrbit.endFile();
// Output File
CZMLFile CZMLfile = new CZMLFile(pathName,outputPath);
CZMLFile.write(header);
CZMLFile.write(satelliteOrbit);
```
# Use with Cesium Sandbox
The [cesium sandbox](https://sandcastle.cesium.com) is a web interface that allows the user to display online [CesiumJS](https://cesium.com/platform/cesiumjs/) code for visualisation. CesiumJS is a javascript library that can displays 3D scenes around central bodies. CesiumJS understands CZML file and can load them into the scene.