ThinkGeo.com    |     Documentation    |     Premium Support

Creating heat map out of cloud elevation data

Hey,

I’m trying to create “nice” heat map based on elevation data you provide via cloud services.
I can’t seem to find too many examples on this but I managed to visualize the data. How ever… heat map doesn’t look “quite right” to me. Any pointers on how to improve it?

Thanks.

public async Task VisualizeElevation()
{
    try
    {
        const int srid = 3857;
        const double elevationDistance = 20;
        const DistanceUnit elevationDistanceUnit = DistanceUnit.Meter;

        var elevationClient = new ElevationCloudClient(ThinkGeoTrial.ClientId, ThinkGeoTrial.ClientSecret);
        var result = await elevationClient.GetElevationOfAreaAsync(Map.CurrentExtent, srid, elevationDistance, elevationDistanceUnit);

        // here we get the correct layer...

        layer.Open();
        layer.InternalFeatures.Clear();

        layer.EditTools.BeginTransaction();
        foreach (var elevation in result.ElevationPoints)
        {
            var featureDictionary = new Dictionary<string, string>
            {
                { "Elevation", elevation.Elevation.ToString(CultureInfo.InvariantCulture) }
            };

            var feature = new Feature(elevation.Point, featureDictionary);
            layer.EditTools.Add(feature);
        }
        layer.EditTools.CommitTransaction();

        var heat = new HeatStyle
        {
            Alpha = 180,
            PointIntensity = 10,
            IntensityColumnName = "Elevation",
            PointRadius = elevationDistance * 2,
            PointRadiusUnit = elevationDistanceUnit,
            IntensityRangeStart = 0,
            IntensityRangeEnd = 8000
        };

        layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Clear();
        layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(heat);
        layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

        // refresh overlay etc...
    }
    catch (ArgumentException) // thrown if no elevation data is found
    {}
}

Thanks Mikko,
There are few things you could try

  1. We need set layerOverlay.TileType = TileType.SingleTile;
  2. You could try with different parameters for the HeatStyle and get the best result.

Thanks

Frank

1 Like