# Multiple Objects

**URL:** <https://community.cesium.com/t/multiple-objects/1799>\
**Category:** CesiumJS\
**Created:** [December 24, 2014, 4:49am UTC](https://community.cesium.com/t/multiple-objects/1799 "2014-12-24T04:49:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Erikson](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/mark_erikson/32/2024_2.png) [@Mark\_Erikson](https://community.cesium.com/u/Mark_Erikson)\
**Post date:** [December 24, 2014, 4:49am UTC](https://community.cesium.com/t/multiple-objects/1799/1 "2014-12-24T04:49:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Matt\_Amato](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/matt_amato/32/1993_2.png) [@Matt\_Amato](https://community.cesium.com/u/Matt_Amato)\
**Post date:** [December 29, 2014, 2:51pm UTC](https://community.cesium.com/t/multiple-objects/1799/2 "2014-12-29T14:51:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mark\_Erikson](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/mark_erikson/32/2024_2.png) [@Mark\_Erikson](https://community.cesium.com/u/Mark_Erikson)\
**Post date:** [January 3, 2015, 8:12am UTC](https://community.cesium.com/t/multiple-objects/1799/3 "2015-01-03T08:12:16Z")

</div>

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/](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](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](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
