HeatMap

Heat maps represent the geographic density of point features on a map by using colored areas to represent those points. Heat maps can be created from point layers that allow configuration of symbology. This includes feature layers, Spatial Data Service (SDS) layers, geoRSS layers, and graphics layers.

About heat maps

When a layer contains a large number of point features, showing each feature individually on the map is often not useful. In this scenario, point features often overlap, making it difficult to distinguish between features. Even when they do not overlap, it is usually difficult or impossible to visually extract meaningful information when hundreds or thousands of points are shown all at once.

One approach to resolving this issue is to generate a heat map. A heat map represents the geographic density of point features on a map by using colored areas to represent those points. The areas will be largest where the most points are concentrated together. Also, areas of high density, or hot spots, will be symbolized with the color chosen to represent hot areas. While heat maps in general can also incorporate one or more attributes into how they are calculated, heat maps in the ArcGIS Runtime SDK for WPF only account for geographic location. Consequently, heat maps in the runtime provide an effective way to visualize where the point features in a given layer are most concentrated.

Adding a HeatMap

You can add a heat map using Extensible Application Markup Language (XAML) and C# code. In XAML, they should be inserted inside a Map control element below any base layers. If you have not already done so, create a Windows Presentation Foundation (WPF) application with a map (see Creating a map for details).

NoteNote:

The code in this topic requires a reference to the ESRI.ArcGIS.Client and ESRI.ArcGIS.Client.Toolkit.Datasources assemblies. The XAML of the Window (for example, MainWindow.xaml) needs to have the following Extensible Markup Language (XML) namespace declaration:

xmlns:esri="http://schemas.esri.com/arcgis/client/2009"
  1. In the Map element, declare a HeatMapLayer with an ID of MyHeatMap as shown in the following code sample:
    <esri:Map x:Name="MyMap" >
      <esri:Map.Layers>
         <esri:HeatMapLayer ID="MyHeatMap"/>
      </esri:Map.Layers>
    </esri:Map>
    
  2. Initialize the layers by calling the Layers_Initialized event that you will define in the next few steps.
    MyMap.Layers.LayersInitialized += Layers_LayersInitialized;
    
  3. Create the Layers_Initialized event and create a new heatmap layer.
    void Layers_LayersInitialized(object sender, EventArgs args)
            {
                HeatMapLayer layer = MyMap.Layers["MyHeatMap"] as HeatMapLayer;
            }
    
  4. Add your points to the heatmap. Here you will be creating random points to assign to the heatmap as an example.
    void Layers_LayersInitialized(object sender, EventArgs args)
            {
                HeatMapLayer layer = MyMap.Layers["MyHeatMap"] as HeatMapLayer;
    
                Random rand = new Random();
                for (int i = 0; i < 1000; i++)
                {
                    double x = rand.NextDouble() * MyMap.Extent.Width - MyMap.Extent.Width / 2;
                    double y = rand.NextDouble() * MyMap.Extent.Height - MyMap.Extent.Height / 2;
                    layer.HeatMapPoints.Add(new ESRI.ArcGIS.Client.Geometry.MapPoint(x, y));
                }
            }
    
1/27/2015