2 questions on displaying files on cesium

hi.

i new in cesium and i have 2 questions:

I have an arcGis shape file. (.shp). i want to display this file on the globe.

i have read that i need to convert this file to ‘CZML’, so i convert this file.

but how i display this file on the globe?

i saw this page “https://github.com/AnalyticalGraphicsInc/cesium/wiki/CZML-in-Cesium”, but there things like clock that i dont need…

because i have a static file…

what is the shortest way to display the shape file?

  1. I have “.tif” file. how can i display it ?

thanks everyone!!

1 put your cxml file on a web server, just like the "simple.czml" and "Vehicle.czml" which used in czml demo. you can't read it from local file system.
2 publish the tif file via a WMS service, and use WMSImageryProvider. you can use GeoServer.

  1. can you give me a simple example how to add czml file?
  2. i saw here “http://cesiumjs.org/2013/01/04/Cesium-Imagery-Layers-Tutorial/

this code:

layers.addImageryProvider(new Cesium.SingleTileImageryProvider({
    url : '../images/Cesium_Logo_overlay.png',
    extent : new Cesium.Extent(
        Cesium.Math.toRadians(-75.0),
        Cesium.Math.toRadians(28.0),
        Cesium.Math.toRadians(-67.0),
        Cesium.Math.toRadians(29.75))
}));

what is the diffrences?

1 put following code in an html file hosted on a web server:
var viewer = new Cesium.Viewer('cesiumContainer');
viewer.extend(Cesium.viewerDynamicObjectMixin);
    var czmlDataSource = new Cesium.CzmlDataSource();
    czmlDataSource.loadUrl('./sample.czml').then(function() {
        viewer.dataSources.add(czmlDataSource);
        viewer.homeButton.viewModel.command();
    });
sample.czml is in the same folder with the html file. For shape file, I prefer to convert it to GeoJson or KML, since these datasources are simpler and easier to understand.

2 SingleTileImageryProvider may only suitable for small images. I guess it gets tiled imageries from an single image at runtime, which will too slow for large images.

I think displaying data on cesium is the most important part: is there any examples (of converting data to KML) then display on the top of terrain. I think users usually won’t just use Bing map or Google map(these can be thought as base data); users usually have their own spatial data (vector and raster) to be visualized in 3d for example utility company has water supplying lines data, oil gas industry has pipeline data, public transit has traffic data, government has land planning data. It would be great that Cesium to connect a spatial database(such as PostGIS, Oracle Spatial or SQL Server), then data is pulled from the database and displayed on the terrain. It’s also good that users can create their own terrain with more detailed elevation data such as from LiDAR. Then users can add some customized functions such as zoom to location based on different coordinate system, routing, upload GPS data; then add some trivial things such as scale display(it could be trick because in 3d, there’s a depth element, scales in near and far are different, but scale is the element you cannot be missed as a map) , north arrow.

Too bad no one replied on your comment. I'm searching for answer is it possible to add data from my own PostGIS database and how? Also, is it possible to connect with OpenStreetMap through WMS/WFS or do I have to download the data first?
And where can I find a list of data formats which Cesium supports?

For your first question, I also had shapefiles, converted them into GeoJSON. and since you are saying your data is only static.. then GeoJSON is also very okay with you.. no need for the CZML
and you can convert them using QGIS, which in case you don't already have it, is a open source software, just install on your pc... no need of fees.
plus (do pay attention to changing the CRS to CRS 4326.

the way to add them to your Cesium is simple.. follow either one of these following codes :

1. var data = Cesium.GeoJsonDataSource.load ('data.geojson');
  viewer.dataSources.add(data);

2. viewer.dataSources.add(Cesium.GeoJsonDataSource.load ('data.geojson', {
  stroke : Cesium.Color.HOTPINK,
  fill : Cesium.Color.PINK,
  strokeWidth: 3,
  markerSymbol : '?' });