public static void WriteKml(IDictionary <GeoCodedLocation, int> dict, string filePath) { int maxValue = dict.Count > 0 ? dict.Max(kv => kv.Value) : 1; using (KmlWriter kmlWriter = new KmlWriter(filePath)) { foreach (var kv in dict) { kmlWriter.WriteCity(kv.Key, 1 + (double)kv.Value * 2 / maxValue, kv.Value); } } }
public void WriteKml(string filePath) { using (KmlWriter kmlWriter = new KmlWriter(filePath)) { foreach (var city in locationToConnectionsCount) { kmlWriter.WriteCity(city.Key, 1 + (double)city.Value * 2 / maxLocationValue, city.Value); } foreach (var connection in usedConnections) { double width = 1 + (double)connection.Value * 4 / maxConnectionValue; kmlWriter.WriteLine(connection.Key.Item1, connection.Key.Item2, width, connection.Value); } } }