Multiple Objects

For borders, check out the Natural Earth project at http://www.naturalearthdata.com/ . Some nice vector data sets there.

Can you post your CZML? If so I can take a quick look for you.

Ah, good point.

So, last year I had a similar task of needing to generate a file of vector country borders and a file of country label locations for the Cesium-based app we were building. I started with the Natural Earth “110m Country” dataset available at http://www.naturalearthdata.com/downloads/110m-cultural-vectors/110m-admin-0-countries/ . The zip file available for download contains data in the “ESRI shapefile” format ( https://en.wikipedia.org/wiki/Shapefile ), which is a widely used geodata format for vector data.

Now, Cesium doesn’t understand shapefiles directly. However, there is a “CZML-Writer” project that is able to do some offline conversion of data into CZML format ( https://github.com/AnalyticalGraphicsInc/czml-writer ). I wound up cloning that repo, poking around the C# version implementation, and adding some abilities to it to allow it to perform the exact conversion process I wanted. If I remember right, it had shapefile logic in the codebase, but for some reason it wasn’t actually hooked up to the CLI at the time. Also, I wanted to do some filtering of what shapefile entries were being converted based on some of the data attributes, and spent some time adding a custom bit of argument handling based on a 3rd-party expression parsing library. I also generated the country label locations based on calculating the centroids of the largest single polygon for each country, which produced adequate results (found out later that apparently label placement is actually an area of pretty serious academic research).

Ultimately, I was able to produce the two CZML files I needed, and moved on. I tried to get permission to submit my CZML-Writer changes back to the Cesium project, but got shot down at the time. I’ll be back into the office on Monday, and may take another stab at getting those submitted.

In any case, the TL;DR version is that ultimately you’ll need to take the polygon geocoordinates in the Natural Earth shapefiles and turn those into CZML polygon entries. Hopefully that’ll give you enough of a pointer to work from.

Mark Erikson