/// <summary> /// Return a string in KML format containing all pre animation definitions /// that are required for the aircraft /// </summary> /// <returns></returns> public string KMLSetup() { RDToGeographic converter = new RDToGeographic(); string heatmapSetup = "<Folder>"; for (int i = 1; i < _population.Count; i++) { if (i % 1000 == 0) { Console.WriteLine(i); } double[] row = _population[i]; var point = converter.convertToLatLong(row[0], row[1]); var test = new GeoPoint3D(point.X, point.Y, 0); var upperRight = test.MoveInDirection(DotSize, 45); var lowerLeft = test.MoveInDirection(DotSize, 225); heatmapSetup += @" <GroundOverlay> <name> house" + i + @"</name> <Icon> <href>" + DotFile + @"</href> </Icon> <LatLonBox> <north>" + upperRight.Latitude + @"</north> <south>" + lowerLeft.Latitude + @"</south> <east>" + upperRight.Longitude + @"</east> <west>" + lowerLeft.Longitude + @"</west> </LatLonBox> </GroundOverlay> "; } heatmapSetup += @"</Folder>"; return(heatmapSetup); }
public void inputGHeat() { RDToGeographic converter = new RDToGeographic(); using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"points.txt")) foreach (int[] row in _populationData) { PointF point = converter.convertToLatLong(row[0], row[1]); file.WriteLine(row[2] + "," + point.Y + "," + point.X); } }
public void ConvertLatLong() { x = 122202; y = 487250; RDToGeographic converter = new RDToGeographic(); PointF point = converter.convertToLatLong(x, y); Assert.AreEqual("4.905598", point.X.ToString()); Assert.AreEqual("52.37214", point.Y.ToString()); Assert.AreEqual("4.905598, 52.37214", string.Format("{0}, {1}", point.X.ToString(CultureInfo.InvariantCulture.NumberFormat), point.Y.ToString(CultureInfo.InvariantCulture.NumberFormat)) ); }