I have a set of points(lat, lon and other attributes) stored as an Asset in Google Earth Engine. I import this asset as a Feature Collection and visualize the points over Satellite Imagery in Google Earth Engine. I would like to generate a heat map from these points.

I searched extensively over the web, but could not find any resource elaborating on doing this in Google Earth Engine. I did come across this documentation https://developers.google.com/maps/documentation/javascript/examples/layer-heatmap of the Google Maps JS API that uses |google.maps.visualization.HeatmapLayer|.

Is there an equivalent of this in Google Earth Engine?

1 Answer 1


There is not a heatmap function that I know of in Earth Engine but you can create your own using some neighborhood operations that are available in EE. Here is an example:

// 'fc' is the feature collection of points
var points = fc.map(function(feature){
  return feature.set('dummy',1);

function heatmap(fc,radius){
  var ptImg = points.reduceToImage(['dummy'],ee.Reducer.first()).unmask(0);
  var kernel = ee.Kernel.circle(radius);
  var result = ptImg.convolve(kernel);
  return result.updateMask(result.neq(0));

var heatmapImg = heatmap(points,20);

var gradient = ['lightgreen','yellow','red'];


And here is the link. I hope this helps!

  • That is actually a nice approach.
    – g07kore
    Jan 8, 2020 at 7:59
  • 1
    You can add a bit of smoothing with a gaussian kernel too. e.g. var kernel = ee.Kernel.circle(radius).add(ee.Kernel.gaussian(radius * 2, radius/2)) May 10, 2021 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.