Format for Geojson files load into Cesium Ion

Hi
I am having trouble undertsanding exactly what is supported by Cesium Ion. I am loading Geojson files into my assets and adding them to my stories , so I am not able to manipulate them with code. So i need to ensure the Geojson file are properly formatted. I am especially interested in what the defaults are and what tags are not suppported.

Can someone please point me to a document that shows what tags are supported.

Thank you advance.

Hi Wayne,

You can visit our guide to uploading data to Cesium ion here. Please follow up with any additional questions you may have.

Hi Dzung
Thanks for your response.

I have read the guide and that’s not what I need.

I need to know what Geojson format is supported in Cesium. The actual specification of what is compliant mark up.

For example you have a kml guide that documents what mark up you support for kml files that are uploaded see (https://github.com/CesiumGS/cesium/issues/873).

Can you please provide information or a guide about what Geojson mark up is supported in Cesium.

I need to know this so I can format my Geojson files for loading into Cesium Ion. These files will not be manipulated in code so styling options need to be specified in the file.

To be clear I will give you an example, I am currently loading the file (below) into Cesium Ion as an asset. The screenshot (below) is the result.

I would like to know how I can;

  1. Clamp the marker to ground ?
  2. Include a label in the marker ?
  3. Change the marker to a different icon ?

Thank you.

======Geojson file ==============

{
“type”: “FeatureCollection”,
“features”: [
{
“type”: “Feature”,
“properties”: {
“name”: “-add name”,
“description”: “-add description”,
“tags”: [“testing”,“testng2”],
“markerSymbol”:"?",
“color”: [
1,
0.9019607843137255,
0,
1
]
},
“geometry”: {
“type”: “Point”,
“coordinates”: [

18.291083,49.029256,296.07

]
}
} ]
}

Hi Dzung

I also have some additional questions regarding kml vs geojson.

I am evaluating whether to use kml or geojson to annotate my 3D models and I am trying to understand which one is best to use.
I have loaded in two files to Cesium ion to place markers on my 3D model and have obtained very different results although the coordinates were exactly the same.

Questions

  1. How do I stop the Geojson marker from partially being obscured when I zoom in ? What mark up do I use in the Geojson file ? Can you point me to geojson examples that are supported, not code example actual file formats please.
  2. Why is the kml file not working ? It has exactly the same coordinates as the Geojson file but produces incorrect results and changes position when I change the camera angle.
  3. The kml format supported by Cesium is documented in https://github.com/CesiumGS/cesium/issues/873 but doesn’t seem to work. Is there a different document ?

Objective
My objective was to place a marker exactly on the corner of the hatch on the roof of the bus. I used two different file formats, one Geojson and one kml.

Results
( Blue marker) The Geojson file was successful and the marker stays exactly on the desired spot whichever angle I view it from. Except for when I zoom in, it partially disappears when I do this.

(Yellow marker )The kml file was not successful. It was incorrectly positioned and changes position when I view it from different angles.

Geojson Data

Geojson file loaded

For the GeoJSON format, you can find the specifications for GeoJSON linked in our GeoJsonDataSource documentation. Clamp to ground is not a spec feature, but we automatically clamp markers to the ground in Cesium Stories. We also recently added support for simplestyle. You can add a marker-symbol to the markers. You can also add a title (which appears when you hover over the marker). I’m less sure about this but you can try setting a name attribute as suggested here.

For the additional questions on your latest post:

  1. Unfortunately, without code, you might have to go in and shift the height of the obscured markers.
  2. This seems like it could be a bug. I will check with our team and get back to you on this.
  3. This is the most updated kml format document we have. What doesn’t seem to work for you (beside the one mentioned in the previous question)? Did you have problems while uploading it or is there a property listed as supported on the kml format document that you couldn’t get to work?

I wanted to double check, are your rounding for kml and geojson files the same for coordinates?

I doubled checked with our team and the discrepancy between the positions of markers in the kml file and the geojson file might be caused by a height reference in the kml file that prevents the markers to be clamped to the ground (since Cesium Stories automatically clamp markers).

Hi Dzung

I have just tested the kml file again this time with 0 height and I get the same result.
For both the Geojson file and the kml file (both below) coordinates are identical so they should produce the same result.
I haven’t been able to test many more kml features as the basic coordinates x,yz need to work before I can use the other features. I really would like to use the other features, however I need the basic ones working first.

You can view the story here.

https://cesium.com/ion/stories/viewer/?id=79863a37-61da-4cb5-8126-2c88b06d2862

Questions Remaining

  1. Can you confirm the kml coordinates x,y,z are working correctly with a kml file ?
  2. Can you explain exactly what clamp to Ground means ? Because I can specify a height that is hovering above an object (see story above) and the marker is correctly positioned in the air.

I will continue with the Geojson file no doubt with some more questions.

Thanks

<?xml version="1.0" encoding="UTF-8"?> Doc name ff0000cc random 1.5 002 1 This is the description...... 1 18.291083,49.029256,296.07

{

“type”: “FeatureCollection”,
“features”: [
{
“type”: “Feature”,

“properties”: {
“name”: “-add name”,
“description”: “-add description”,
“tags”: [“testing”,“testng2”],
“markerSymbol”:"?",
“color”: [
1,
0.9019607843137255,
0,
1
]
},
“geometry”: {
“type”: “Point”,
“coordinates”: [

18.291083,49.029256,296.07

]
}
} ]
}

Hi Dzung

I have just observed some strange behaviour. When you first load the story the kml marker appears in the correct position for about 0.5 seconds then it moves to the ground.
So it seems the coordinates and the height may be working for a brief moment, then a bug kicks in and moves it.

https://cesium.com/ion/stories/viewer/?id=79863a37-61da-4cb5-8126-2c88b06d2862

Can you please load the story and observe the behaviour and see how to correct it ?

Thanks and look forward to hearing from you.

Wayne

Hi Dzung

It’s been a while and I haven’t had an answer for this one yet.

Can you please come back to me.

Wayne