best way to display lots of points

I have ~230K points that I would like to display but I have a lot of performance issues with anything above 50K. Below is a sample entry in the czml file that I am using.

[
  {
    "id": "1",
    "position": { "cartographicDegrees": [0,0,0] },
    "point" : {
      "color" : { "rgba" : [0,255,255,255]},
      "pixelSize" : 10,
      "show" : true
    }
  }
]

Do you have any recommendations for improvement or do you think that cesium is the wrong product? Surprisingly the STK 10.1 MTO object works well with the same dataset.

In time, CZML will be able to handle this no problem. In the meantime, there is an experimental point geometry in a branch you could use:

https://github.com/AnalyticalGraphicsInc/cesium/compare/master...pointgeometry

On a good GPU, it can do 10+ million points.

Patrick

Hi,
Any chance of integrating this into master before 1.0?
I would love to see this in cesium..
Thanks.

This will not make 1.0. In the meantime, you could use this branch directly. We’ll update it with master shortly after the 1.0 release on August 1.

Patrick

Do you have any sample code that will display a few PointGeometry objects? I am just trying to get a few points with varying color up on a sandbox example. Brainpower for me is low right now. Thanks!

No, if you bring down that branch, it should be simple to convert one of the short geometry examples to use the point geometry and appearance. Keep in mind that the point geometry takes a typed array, not an array of Cartesian3. This is, of course, subject to change when it gets ready for production.

Patrick

I am having trouble figuring it out. Here is what I have. Getting the error “DeveloperError: Appearance/Geometry mismatch. The appearance requires vertex shader attribute input ‘normal’, which was not computed as part of the Geometry. Use the appearance’s vertexFormat property when constructing the geometry.”:

require([‘Cesium’], function(Cesium) {

“use strict”;

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var scene = viewer.scene;

var primitives = scene.primitives;

var myPoint=Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);

var pointInstance = new Cesium.GeometryInstance({

geometry : new Cesium.PointGeometry({

positionsTypedArray: [myPoint.x, myPoint.y, myPoint.z],

colorsTypedArray: [1.0,0.0,0.0,0.5],

vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT

}),

id : ‘point’,

attributes : {

color : new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 0.5)

}

});

scene.primitives.add(new Cesium.Primitive({

geometryInstances : [pointInstance],

appearance : new Cesium.PerInstanceColorAppearance()

}));

Sandcastle.finishedLoading();

});

I finally figured it out:

require([‘Cesium’], function(Cesium) {

“use strict”;

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var scene = viewer.scene;

var primitives = scene.primitives;

var myPoint=Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);

var typedArray = [ myPoint.x, myPoint.y, myPoint.z];

var pointInstance = new Cesium.GeometryInstance({

geometry : new Cesium.PointGeometry({

positionsTypedArray: typedArray

}),

id : ‘point’,

attributes : {

color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)

}

});

scene.primitives.add(new Cesium.Primitive({

geometryInstances : [pointInstance],

appearance : new Cesium.PointAppearance()

}));

Sandcastle.finishedLoading();

});

Patrick, any chance you could find time to update the pointgeometry branch with master? We are making use of it to do some pointcloud work.

Hi Ashley,

Good timing actually. We are planning point cloud support now. Keep an eye out.

Patrick

Thank you for this thread, I was actually trying to do the exact same thing with pretty much the exact same CZML. I am now using the experimental point geometry branch linked to from this thread until it's merged to the master, but I have a question for you or anyone who knows.

How can I change the pixel size attribute of the pixels like you can with the pixelSize attribute in the CZML? I'm probably doing something dumb, but nothing I've tried works so far.

Hi - that branch doesn’t have support for changing the point size yet, but you could hack it by changing gl_PointSize here and then rebuilding.

Patrick

I have ~230K points that I would like to display but I have a lot of performance issues with anything above 50K. Below is a sample entry in the czml file that I am using.

[
  {
    "id": "1",
    "position": { "cartographicDegrees": [0,0,0] },
    "point" : {
      "color" : { "rgba" : [0,255,255,255]},
      "pixelSize" : 10,
      "show" : true
    }
  }
]

Do you have any recommendations for improvement or do you think that cesium is the wrong product? Surprisingly the STK 10.1 MTO object works well with the same dataset.

Any update on a better ways to show ~230k points. I just tried the newer (build 1.28) importing a cxml file and I still have memory issues and slowness.

See this blog post for some tips! http://cesiumjs.org/2016/03/02/Performance-Tips-for-Points/

-Hannah