Issues with Shapefile to CZML conversion


I am trying to convert a shape file to CZML to display in the Cesium viewer, but I am running into some issues. Basically, most of the polygon geometry is missing, and this is even true for the sample shapefiles provided in the converter.

Here is my process:

  1. Downloaded the source code for the czml-writer with the shape conversion library from here:
  2. Wrote a little console app to run the converter code on a shape file
  3. Run the code on the sample file: 110m_ocean.shp
  4. Copy and paste the resulting polygons from the new czml file into this sandcastle URL:

Here is an image of what I’m getting in the online Cesium Viewer (polygons shown in red):

I know this isn’t correct because I looked at the shape file through ArcGis and it looks good:

It seems like the converter has issues files with large polygons, because it seemed to work fine for the other samples. Is it possible the converter has a bug? Is there any workarounds possible? Am I doing something wrong?



The shapefile to CZML conversion was created several years ago, before Cesium had native support for GeoJSON, and has not been maintained or tested since. You will probably have better results by converting to GeoJSON instead of CZML using a tool like ogr2ogr.