// method meant for testing lat long data files public void TestDataFiles() { string URL = @"C:\Users\DevWork\Desktop\"; string URL_ALPHA_VALUES = URL + "1.txt"; ParserManager P = new ParserManager(); P.execute(); List <double> lats = P.latitudeValues; List <double> lngs = P.longitudeValues; List <double> alphaValues = P.alphaValues; double min = P.getMin(alphaValues); double max = P.getMax(alphaValues); P.scale(alphaValues); Image img = getGmapImage(); RenderBitmaps(lats, lngs, alphaValues, img); }
// TEST SCALE public void displayMarkers() { BitmapCalculator bc = new BitmapCalculator(); ParserManager P = new ParserManager(); P.execute(); List <double> lats = P.latitudeValues; List <double> lngs = P.longitudeValues; List <double> alphaValues = P.alphaValues; P.scale(alphaValues); ParserManager P2 = new ParserManager("p_2.txt"); P2.execute(); List <double> alphaValues2 = P2.alphaValues; /*foreach (double i in alphaValues2) * { * Console.WriteLine(i); * }*/ P2.scale(alphaValues2); /* * 1. Add epsilon to alphaValues until p2.txt values reached * 2. Render image for each alphaValues + n * epsilon * 3. Automize image export process */ /*for (int i = 0; i <= 100; i++) * { * for (int j = 0; j < alphaValues.Count; j++) * { * double diff = Math.Abs(alphaValues[j] - alphaValues2[j]); * alphaValues[j] *= (diff * i / 100); * } * }*/ // 1. Create the overlay GMapOverlay markers = new GMapOverlay("markers"); int count = 0; for (int i = 0; i < lats.Count; i++) { //Console.WriteLine(lats[i]); for (int j = 0; j < lngs.Count; j++) { //Console.WriteLine(lats[i] + " " + lngs[j]); PointLatLng point = new PointLatLng(lats[i], lngs[j]); Bitmap temp = getAlphaMap((int)alphaValues[count], 3, 3); GMapMarker marker = new GMarkerGoogle(point, temp); // 2. Add markers markers.Markers.Add(marker); // 3. Cover map with overlay count++; } } gmap.Overlays.Add(markers); // TEST BITMAP CALCULATOR PointF topLeft = new PointF(); PointF topRight = new PointF(); PointF botLeft = new PointF(); PointF botRight = new PointF(); //lng = x, lat = y topLeft.X = (float)gmap.ViewArea.LocationTopLeft.Lng; topLeft.Y = (float)gmap.ViewArea.LocationTopLeft.Lat; topRight.X = (float)(gmap.ViewArea.LocationTopLeft.Lng + gmap.ViewArea.WidthLng); topRight.Y = topLeft.Y; botRight.X = (float)gmap.ViewArea.LocationRightBottom.Lng; botRight.Y = (float)gmap.ViewArea.LocationRightBottom.Lat; botLeft.X = (float)(gmap.ViewArea.LocationRightBottom.Lng - gmap.ViewArea.WidthLng); botLeft.Y = botRight.Y; Console.WriteLine("TL: " + topLeft.ToString()); Console.WriteLine("TR: " + topRight.ToString()); Console.WriteLine("BR: " + botRight.ToString()); Console.WriteLine("BL: " + botLeft.ToString()); // calculate distances double maxWidthDistance = bc.calculateDistance(System.Convert.ToDouble(topLeft.Y), System.Convert.ToDouble(topLeft.X), System.Convert.ToDouble(topRight.Y), System.Convert.ToDouble(topRight.X)); double maxHeightDistance = bc.calculateDistance(System.Convert.ToDouble(topLeft.Y), System.Convert.ToDouble(topLeft.X), System.Convert.ToDouble(botRight.Y), System.Convert.ToDouble(botRight.X)); //double maxWidthDistance2 = bc.calculateDistance(lats[0], lngs[0], lats[0], lngs[lngs.Count - 1]); Console.WriteLine("WIDTH IN KM: " + maxWidthDistance / 1000); Console.WriteLine("HEIGHT IN KM: " + maxHeightDistance / 1000); }