Example #1
0
        ////////////// Private Member Method ///////////////////////////////////


        private void ExtractElevation()
        {
            float SampleRatio;

            GooglePosition[] TempPosition;

            TempPosition = new GooglePosition[2];

            TempPosition[0] = new GooglePosition();
            TempPosition[1] = new GooglePosition();

            TempPosition[0].Latitude  = Position[0].Latitude;
            TempPosition[0].Longitude = Position[0].Longitude;

            TempPosition[1].Latitude  = Position[1].Latitude;
            TempPosition[1].Longitude = Position[1].Longitude;

            if (Position[0].Latitude != Position[1].Latitude)                                  // Area Selected , ROI
            {
                SampleRatio = ((Position[0].Longitude - Position[1].Longitude) / SampleCount); // for symmetric sampleling

                TempPosition[1].Latitude = TempPosition[0].Latitude;

                while (TempPosition[0].Latitude > Position[1].Latitude)
                {
                    GenerateQuery(TempPosition); // build query string

                    // Console.WriteLine("Find for : " + TempPosition[0].Latitude + " , " + TempPosition[0].Longitude + " , " +
                    //                                TempPosition[1].Latitude + " , " + TempPosition[1].Longitude);

                    if (RequestElevation() == true) // execute query string and validation
                    {
                        StoreElevationData();

                        DataHeight++;

                        //Console.WriteLine("--------------------------------------------------------------------"+DataHeight);
                    }
                    else
                    {
                        StoreRandomElevationData();

                        DataHeight++;
                    }


                    TempPosition[0].Latitude += SampleRatio;

                    TempPosition[1].Latitude = TempPosition[0].Latitude;
                }
            }

            System.Console.WriteLine("DataWidth = " + DataWidth + " + DataHeight = " + DataHeight);
        }
Example #2
0
        ////////////// Public Member Method ///////////////////////////////////


        public GoogleElevationPack()
        {
            MaxElevation = -1000;

            RegExpElevation = new Regex(@"[-+]?(\d*[.])?\d+");

            RegExpStatus = new Regex(@"\""status""\s:\s\""\D*""");

            Elevations = new List <GoogleElevation>();

            Position = new GooglePosition[2];

            Position[0] = new GooglePosition();
            Position[1] = new GooglePosition();
        }