# best way to display lots of points

**URL:** <https://community.cesium.com/t/best-way-to-display-lots-of-points/1180>\
**Category:** CesiumJS\
**Created:** [May 1, 2014, 4:27pm UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180 "2014-05-01T16:27:23Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![fxbulldog](https://avatars.discourse-cdn.com/v4/letter/f/ecd19e/32.png) [@fxbulldog](https://community.cesium.com/u/fxbulldog)\
**Post date:** [May 1, 2014, 4:27pm UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/1 "2014-05-01T16:27:23Z")

</div>

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.

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

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.

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/patrick/32/2045_2.png) [@patrick](https://community.cesium.com/u/patrick)\
**Post date:** [May 2, 2014, 3:13am UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/2 "2014-05-02T03:13:46Z")

</div>

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](https://github.com/AnalyticalGraphicsInc/cesium/compare/master...pointgeometry)

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

Patrick

---

<div class="post-metadata">

**Author:** ![netanelgilad](https://avatars.discourse-cdn.com/v4/letter/n/50afbb/32.png) [@netanelgilad](https://community.cesium.com/u/netanelgilad)\
**Post date:** [July 19, 2014, 11:24am UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/3 "2014-07-19T11:24:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/patrick/32/2045_2.png) [@patrick](https://community.cesium.com/u/patrick)\
**Post date:** [July 20, 2014, 12:51pm UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/4 "2014-07-20T12:51:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ashley\_Mort](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ashley_mort/32/8527_2.png) [@Ashley\_Mort](https://community.cesium.com/u/Ashley_Mort)\
**Post date:** [September 18, 2014, 6:46pm UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/5 "2014-09-18T18:46:58Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/patrick/32/2045_2.png) [@patrick](https://community.cesium.com/u/patrick)\
**Post date:** [September 18, 2014, 8:35pm UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/6 "2014-09-18T20:35:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ashley\_Mort](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ashley_mort/32/8527_2.png) [@Ashley\_Mort](https://community.cesium.com/u/Ashley_Mort)\
**Post date:** [September 19, 2014, 2:11am UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/7 "2014-09-19T02:11:59Z")

</div>

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();

});

---

<div class="post-metadata">

**Author:** ![Ashley\_Mort](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ashley_mort/32/8527_2.png) [@Ashley\_Mort](https://community.cesium.com/u/Ashley_Mort)\
**Post date:** [September 19, 2014, 1:04pm UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/8 "2014-09-19T13:04:30Z")

</div>

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();

});

---

<div class="post-metadata">

**Author:** ![Ashley\_Mort](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ashley_mort/32/8527_2.png) [@Ashley\_Mort](https://community.cesium.com/u/Ashley_Mort)\
**Post date:** [October 22, 2014, 6:14pm UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/9 "2014-10-22T18:14:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/patrick/32/2045_2.png) [@patrick](https://community.cesium.com/u/patrick)\
**Post date:** [October 22, 2014, 10:23pm UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/10 "2014-10-22T22:23:49Z")

</div>

Hi Ashley,

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

Patrick

---

<div class="post-metadata">

**Author:** ![DB1](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@DB1](https://community.cesium.com/u/DB1)\
**Post date:** [November 11, 2014, 5:29pm UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/11 "2014-11-11T17:29:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/patrick/32/2045_2.png) [@patrick](https://community.cesium.com/u/patrick)\
**Post date:** [November 11, 2014, 8:22pm UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/12 "2014-11-11T20:22:35Z")

</div>

Hi - that branch doesn’t have support for changing the point size yet, but you could hack it by changing gl\_PointSize [here](https://github.com/AnalyticalGraphicsInc/cesium/compare/pointgeometry#diff-6229086bc90b42f496285714f2abaf8cR12) and then rebuilding.

Patrick

---

<div class="post-metadata">

**Author:** ![fxbulldog](https://avatars.discourse-cdn.com/v4/letter/f/ecd19e/32.png) [@fxbulldog](https://community.cesium.com/u/fxbulldog)\
**Post date:** [January 3, 2017, 8:32pm UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/13 "2017-01-03T20:32:44Z")

</div>

> 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.
> 
> [  
> &nbsp;&nbsp;{  
> &nbsp;&nbsp;&nbsp;&nbsp;"id": "1",  
> &nbsp;&nbsp;&nbsp;&nbsp;"position": { "cartographicDegrees": [0,0,0] },  
> &nbsp;&nbsp;&nbsp;&nbsp;"point" : {  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"color" : { "rgba" : [0,255,255,255]},  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"pixelSize" : 10,  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"show" : true  
> &nbsp;&nbsp;&nbsp;&nbsp;}  
> &nbsp;&nbsp;}  
> ]
> 
> 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.

---

<div class="post-metadata">

**Author:** ![fxbulldog](https://avatars.discourse-cdn.com/v4/letter/f/ecd19e/32.png) [@fxbulldog](https://community.cesium.com/u/fxbulldog)\
**Post date:** [January 3, 2017, 8:35pm UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/14 "2017-01-03T20:35:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [January 3, 2017, 9:25pm UTC](https://community.cesium.com/t/best-way-to-display-lots-of-points/1180/15 "2017-01-03T21:25:20Z")

</div>

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

-Hannah
