public TileMaker() { JsonConverterSettings = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, MissingMemberHandling = MissingMemberHandling.Ignore, Formatting = Formatting.Indented, DateFormatHandling = DateFormatHandling.IsoDateFormat, }; MapVisualizer = new MapVisualizer(); }
public void JsonToHeatMap(string path = "AltitudeData.json") { string json = File.ReadAllText(path); List <List <AltitudeResponse> > data = JsonConvert.DeserializeObject <List <List <AltitudeResponse> > >(json, jsonConverterSettings); MapVisualizer mapVisualizer = new MapVisualizer(); List <List <MapPoint> > mapMatrix = data .Select(l => l .Select(p => new MapPoint(p.Location.Lat, p.Location.Lng, p.Elevation)) .Distinct().ToList()) .ToList(); List <MapPoint> points = mapMatrix.SelectMany(l => l.ToList()).ToList(); data.Where(l => l != null).ToList(); mapVisualizer.MakeHeatImagePng(points); }