How I can create a heatmap in the cesium ?

Hi,

I’m working at a project and I need create a heatmap, is it possible using the cesium ?

how do?

there is any example how do this in the cesium ?

thank’s

Hello,

Are you looking to create heat maps in real time? Or just to display a heatmap?

If you want to display a heatmap, you can use code found in the cesium layers:

to add a layer:

addAdditionalLayerOption(

‘retail’,

new Cesium.SingleTileImageryProvider({

url: ‘…/…/geoJSON/retailExport.png’,

rectangle: Cesium.Rectangle.fromDegrees(-77.10422863152833, 38.831623408824335, -76.91154397619952, 38.980991358691625)

}),

you have to provide the heatmaps as png file and give the bounding coordinates.

Thank’s your answer, but what I need really is create a heatmap in real time, I have a matrix " n x n" where each cell have one pair coordinates in degrees and a value of concentration, I need to display this matrix how a heatmap

thank

You need to convert your matrix to image(s). It can be done 1. on your server or 2. in client (browser) code.

In 1st case, make one or some heatmap bitmaps and place them on your server. Use SingleTileImageryProvider or TileMapServiceImageryProvider with your data url to show all you need with Cesium.

2nd case. You can make your own imagery provider. You will pass your heat data matrix to it, the provider will calculate corresponding images on-the-fly. Look at ImageryProvider code from the Cesium source. Fucntion requestImage from there is responsible for these calculations. You have to write your own.

Hello,

I am working on a similar project. Were you successful in implementing this? If so, can you please highlight your solution?

Thanks and regards.