Export cesium entities to Shapefile

I had added some entities on my project, now how can I export then into shapefile or geojson?

I don’t believe Cesium has a built in way to do this. I searched around a bit and couldn’t find any community projects to do it, but it might not be too hard to try writing one yourself, that iterates over a given collection of entities and creates the shapefile/geojson text and outputs it/downloads it. If you manage to get that working it’d be really cool to share it with the community!

Thanks for the reply.
Is there any possibility of addition of this kind of feature in future updates of cesiumjs.

Typically users tend to convert the other way - trying to put GeoJSON or shape files into Cesium. Can you explain a bit more what kind of work you’re doing that would require this feature? The Cesium team tends to prioritize features that have wider use cases, so a lot of it is community-driven.

I'm creating building and road layouts by using different shapes,lines and polygons, so i want to save the work i have done as geojson.(similar to arcscene) So i can load the work i have done directly.Is it possible.Or will there be any .cesium file in future similar to .shp file.

There is a CZML format:

https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide

Although I’m not aware of any tool that can export a CesiumJS scene into it. That does sound like it could be a pretty cool use case. I think if you are creating these lines, shapes and polygons in your CesiumJS app, you can just loop over all the entities and their properties, and save them as a CZML. You can see a bunch of examples of how CZML looks like on Sandcastle:

I opened a feature request for this because I think it’s a really good idea:

https://github.com/AnalyticalGraphicsInc/cesium/issues/7372

Hi there,
I also needed that feature for my project, so I got down to make it work.

If anyone is interested, here is a sandcastle of how I did it:

basically, the function just loop through the arrays of entites and writes a json file that you can then import back into Cesium

This looks pretty awesome Clara, thank you for sharing that! We also just recently implemented a KML export option that could be useful here as well:

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/index.html?src=Export%20KML.html