Fastest loading data format

I’ve got a bunch of kml - some of it’s pretty large - and i’m interested in knowing the fastest loading format so I can convert it to the right one.

I know the kml data source loader pretty well and have fiddled with it for a variety of reasons. Seems the extra step or parsing and placing cesium calls to install it is a pretty large overhead - at least if looks that way when I profile it. I spend 60 to 90 seconds in that processing structure which locks up the earth while it’s executing.

geoJSON isn’t an option because there’s so much that it doesn’t provide.

Is czml the way to go and does anyone have benchmarks showing that it really is faster and if so by how much?

Finally, is there are more native format I should be looking at?


Ken Johnson

Hi Kenneth,

I think, you should tile your data to draw faster.

3DTile might be the solution that you want.

21 Eylül 2016 Çarşamba 05:49:42 UTC+3 tarihinde Kenneth Johnson yazdı:

Thanks, I agree. For very large datasets, 3D tiles is usually the way to go. You can read more about the format here:
CZML should also have better performance than KML (I don’t have stats on this, sorry) and is useful if you have time dynamic data



CZML also allows you to load smaller packets of data into a single data source, which is useful due to JavaScript’s single-threaded nature. By loading small pieces one at a time you can keep the application more interactive while data loads in, basically doing your own cooperative multi-tasking.

My typical kml is typically 10 to 20K placemarks for points, lines, and polygons so it’s not tiles. It takes quite a while to parse that kind of kml and create all the entities with styling and such. I can see the calls in the profiler. I do have some that are overlays and tiling works very well for that. If I’ missing something relative to tiles point me in the right direction and i’m off folks.


Always good to have your input. So your take is czml will load faster than kml - which make sense to me.

I’m going to convert the kml to czml and then run them both so i’ll have performance numbers i’ll post.

Is there an online converter? I’m the the process is setting up the czml converter but if there’s an online converter i can get numbers pretty quickly and know i’m headed in the right direction.

I don’t know of any online KML converter, sorry.
But yes! Please share your findings =) That would be really helpful. Thanks!


Stupid question - documentation on czml-writer is a bit confusing. Will this convert kl to czml? Looks like there’s info the dotnet version is a standalone app that will do this but not the java.

Any helpful pointers?

The czml-writer no longer has a KML converter. It never really worked properly, and has long since been superseded by native KML support in Cesium.

If all you have as input is KML files, then simply loading those KML files is the best you can do. If your KML are generated from some kind of database or data files, then you could consider generating CZML instead, using the writer library.

I can write the php to convert it. Maybe i’ll have to.

Quesiton - the GE plugin had an ability to write the document back out to a string. I haven’t seen anything like that in cesium - that is - ability to write out a datasource. Given i’m a lazy engineer that would be a useful thing in general and solve my bproblem here. That is, if you could take a data source and spit it back as loadable czml.

So here you go.

I wrote some PHP to translate a 13MB, 341K Linkes of KML file with TImeSpans, Regions, 12K Placemarks, etc. to CZML.

All the fundamental things like regions came over to CZML which is now and 6.9MB and 278K lines of CZML JSON.

And - here are profile numbers between the two loads on localhost.

KML: 7110.792ms

CZML: 3923.816ms

The results are fundamentally identical. I wound’t chalk up much of the difference to the difference in raw file size.

I actually expected the improvement to be larger - but i’ll take a 40% speed up any day!

Wow, that’s great! I wasn’t sure how big the difference would be, but 40% is definitely significant. Thanks for the info!



That’s an honest estimate without fiddling to make it look good. I will say there are features in czml that will probably drop it a lot more when I use them. Primarily the abiulity to use availablity on the positions - that alone will cut the file load by 2/3.

I’ll provide an update.

Do you have a pointer to how to implement streaming on czml file. That’s my next step.



Hi Ken,

The basic gist is that you load in chunks of CZML and call CzmlDataSource.process to modify the existing CZMLDataSource with the data in the chunk. Here’s a more detailed explanation:

There’s also a little bit of discussion in this forum post that may be helpful: