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
{}
}