Example #1
0
        static void Main(string[] args)
        {
            var lines = File.ReadAllLines("streets.txt");
            var list  = lines.Select(line => new Street(line)).ToList();

            list = new List <Street>(list.OrderBy(street => street.Name));
            var dic = FindSameStreet(list).Where(pair => pair.Value.Count > 1);

            Console.WriteLine("Start read coordinate");
            Console.ReadKey(true);
            using (var progresBar = new ConsoleProgress("Update Yandex coordinate"))
            {
                progresBar.SetRange(0, list.Count);
                for (int index = 0; index < list.Count; index++)
                {
                    var street              = list[index];
                    var location            = $"{KievPrefix}{street}";
                    var geoObjectCollection = YandexGeocoder.Geocode(location, 1, LangType.ru_RU);
                    street.UpdateLocation(geoObjectCollection);
                    progresBar.SetProgress(index);
                }
            }

            var validStreets   = list.Where(street => street.CoordinatesCalculated).ToArray();
            var invalidStreets = list.Where(street => !street.CoordinatesCalculated).ToArray();

            Console.WriteLine($"Found {invalidStreets.Length} not valid streets. You can find it in Invalid.json");
            SerializeStreets(invalidStreets, "Invalid");
            Console.WriteLine("Write file name for output");
            var fileName = Console.ReadLine();

            SerializeStreets(validStreets, fileName);
        }
Example #2
0
        public static async Task <Point> GeocodeAsync(string location, GeocodingApi apiType)
        {
            Point result;

            switch (apiType)
            {
            case GeocodingApi.Yandex:
                var codingResult = await YandexGeocoder.GeocodeAsync(location);

                if (!codingResult.Any())
                {
                    return(null);
                }
                var firstPoint = codingResult.First().Point;
                result = new Point
                {
                    Latitude  = firstPoint.Latitude,
                    Longitude = firstPoint.Longitude
                };
                break;

            case GeocodingApi.Google:
                var geocoder = new GoogleGeocoder();
                lock (KeyLock)
                {
                    if (!string.IsNullOrEmpty(_googleApiKey))
                    {
                        geocoder.ApiKey = _googleApiKey;
                    }
                }
                IEnumerable <GoogleAddress> addresses;
                try
                {
                    addresses = await geocoder.GeocodeAsync(location);
                }
                catch (Exception ex)
                {
                    Logger.LogException("GOOGLE GEO", LogLevel.Debug, ex);
                    return(null);
                }

                var firstAddress = addresses?.FirstOrDefault();
                if (firstAddress == null)
                {
                    return(null);
                }
                result = new Point
                {
                    Latitude  = firstAddress.Coordinates.Latitude,
                    Longitude = firstAddress.Coordinates.Longitude
                };

                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(apiType), apiType, null);
            }
            return(result);
        }
Example #3
0
        private static void zjistiPolohu(string location, out string lat, out string lon)
        {
            var results = YandexGeocoder.Geocode(location);

            lat = results[0].Point.Lat.ToString().Replace(',', '.');
            lon = results[0].Point.Long.ToString().Replace(',', '.');
            Console.WriteLine($"Souřadnice zadaného místa.\nZeměpisná šířka: {lat}  zeměpisná délka: {lon}");
        }
Example #4
0
        public async Task <ActionResult> CreatePar([Bind(Include = "Id,Date,FIO,Phone,PlaceBus,RoadType,CoordsFrom,CoordsTo,RouteId")] Client client)
        {
            if (client.RouteId == 0)
            {
                client.RouteId = null;
            }

            var geocoderFrom = new YandexGeocoder
            {
                SearchQuery = client.CoordsFrom,
                Results     = 1,

                LanguageCode = LanguageCode.ru_RU
            };

            var coordFromFirst = geocoderFrom.GetResults();

            if (geocoderFrom.GetResults().Count == 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, "invalid adress"));
            }
            else
            {
                client.CoordsFromR = geocoderFrom.GetResults().First().Point.Latitude + "," + geocoderFrom.GetResults().First().Point.Longitude;
            }

            var geocoderTo = new YandexGeocoder
            {
                SearchQuery = client.CoordsTo,
                Results     = 1,

                LanguageCode = LanguageCode.ru_RU
            };

            if (geocoderTo.GetResults().Count == 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, "invalid adress"));
            }
            else
            {
                client.CoordsToR = geocoderTo.GetResults().First().Point.Latitude + "," + geocoderTo.GetResults().First().Point.Longitude;
            }


            if (ModelState.IsValid)
            {
                db.Clients.Add(client);


                await db.SaveChangesAsync();

                return(new HttpStatusCodeResult(HttpStatusCode.OK));
            }

            return(Content("<h1 style='color:red;'>Ошибка Валидации</h1>"));
        }
Example #5
0
        public Form1()
        {
            InitializeComponent();

            googleGeocoder  = new GoogleGeocoder();
            yandexGeocoder  = new YandexGeocoder();
            geocoder        = new Geocoder();
            tokenizer       = new Tokenizer();
            geocoderService = new GeocoderService();
        }
Example #6
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Date,FIO,Phone,PlaceBus,RoadType,CoordsFrom,CoordsTo,RouteId")] Client client)
        {
            if (client.RouteId == 0)
            {
                client.RouteId = null;
            }

            var geocoderFrom = new YandexGeocoder
            {
                SearchQuery = client.CoordsFrom,
                Results     = 1,

                LanguageCode = LanguageCode.ru_RU
            };

            var coordFromFirst = geocoderFrom.GetResults();

            if (geocoderFrom.GetResults().Count == 0)
            {
                ModelState.AddModelError("Локация", "Адрес Отправки Не Определился");
            }
            else
            {
                client.CoordsFromR = geocoderFrom.GetResults().First().Point.Latitude + "," + geocoderFrom.GetResults().First().Point.Longitude;
            }

            var geocoderTo = new YandexGeocoder
            {
                SearchQuery = client.CoordsTo,
                Results     = 1,

                LanguageCode = LanguageCode.ru_RU
            };

            if (geocoderTo.GetResults().Count == 0)
            {
                ModelState.AddModelError("Локация", "Адрес Прибытия Не Определился");
            }
            else
            {
                client.CoordsToR = geocoderTo.GetResults().First().Point.Latitude + "," + geocoderTo.GetResults().First().Point.Longitude;
            }

            if (ModelState.IsValid)
            {
                db.Entry(client).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index", "Home"));
            }
            ViewBag.RouteId = new SelectList(db.Routes.Where(p => p.DateRoute == client.Date && p.RoadTypeRoute == client.RoadType), "Id", "NameRoute", client.RouteId);
            return(View(client));
        }
Example #7
0
        public static GeoPoint Coord(string str)
        {
            GeoObjectCollection results = YandexGeocoder.Geocode(str, 1, LangType.en_US);


            GeoPoint gh = new GeoPoint();

            foreach (GeoObject re in results)
            {
                gh = re.Point;
            }
            return(gh);
        }
Example #8
0
        public void AssertThatLocationByPointsWorks(double latitude, double longitude, string result)
        {
            var geocoder = new YandexGeocoder
            {
                SearchQuery  = new LocationPoint(latitude, longitude).ToString(),
                Results      = 1,
                LanguageCode = LanguageCode.en_US
            };

            var results = geocoder.GetResults();

            StringAssert.Contains(result, results.First().Text);
        }
Example #9
0
        public static double ff(string str1, string str2)
        {
            GeoObjectCollection results  = YandexGeocoder.Geocode(str1, 1, LangType.en_US);
            GeoObjectCollection results1 = YandexGeocoder.Geocode(str2, 1, LangType.en_US);

            GeoPoint gh  = new GeoPoint();
            GeoPoint gh1 = new GeoPoint();

            foreach (GeoObject re in results)
            {
                gh = re.Point;
            }
            foreach (GeoObject re in results)
            {
                gh = re.Point;
            }
            foreach (GeoObject re in results1)
            {
                gh1 = re.Point;
            }

            if (gh.Lat == 0.0 || gh.Long == 0.0 || gh1.Lat == 0.0 || gh1.Long == 0.0)
            {
                MessageBox.Show("неправильно ввели город");
                Environment.Exit(0);
                return(0);
            }
            else
            {
                double pii    = Math.PI / 180;
                double lat1   = gh.Lat * pii;//gh.Lat*pii;
                double long1  = gh.Long * pii;
                double lat2   = gh1.Lat * pii;
                double long2  = gh1.Long * pii;
                double result = Math.Acos(Math.Sin(lat1) * Math.Sin(lat2) + Math.Cos(lat1) * Math.Cos(lat2) * Math.Cos(long1 - long2));

                double cl1    = Math.Cos(lat1);
                double cl2    = Math.Cos(lat2);
                double sl1    = Math.Sin(lat1);
                double sl2    = Math.Sin(lat2);
                double delta  = long2 - long1;
                double cdelta = Math.Cos(delta);
                double sdelta = Math.Sin(delta);
                double y      = Math.Sqrt(Math.Pow(cl2 * sdelta, 2) + Math.Pow(cl1 * sl2 - sl1 * cl2 * cdelta, 2));
                double x      = sl1 * sl2 + cl1 * cl2 * cdelta;
                double ad     = Math.Atan2(y, x);
                double dist   = ad * 6372795;

                return(result * 6371);
            }
        }
Example #10
0
        public void AssertThatResultsAreCorrect1(int choosenResults, int expectedResults)
        {
            var geocoder = new YandexGeocoder
            {
                SearchQuery  = "тверская 1",
                Results      = choosenResults,
                LanguageCode = LanguageCode.ru_RU
            };

            var results = geocoder.GetResults();

            Console.WriteLine("Results count:" + results.Count);
            Assert.AreEqual(expectedResults, results.Count);
        }
Example #11
0
        public void AssertThatLocaleWorks(string query, LanguageCode locale, string result)
        {
            var geocoder = new YandexGeocoder
            {
                SearchQuery  = query,
                Results      = 1,
                LanguageCode = locale
            };

            var results = geocoder.GetResults();

            Console.WriteLine(results.First());
            Assert.AreEqual(result, results.First().AddressLine);
        }
Example #12
0
        public void ValidatesLocationPoints(double latitude, double longitude, string result)
        {
            var geocoder = new YandexGeocoder
            {
                Apikey       = API_KEY,
                SearchQuery  = new LocationPoint(latitude, longitude).ToString(),
                Results      = 1,
                LanguageCode = LanguageCode.en_US
            };

            var results = geocoder.GetResults();

            StringAssert.Contains(result, results.First().Text);
        }
Example #13
0
        public void ValidatesResultsCount(int chosenResults, int expectedResults)
        {
            var geocoder = new YandexGeocoder
            {
                Apikey       = API_KEY,
                SearchQuery  = "тверская 1",
                Results      = chosenResults,
                LanguageCode = LanguageCode.ru_RU
            };

            var results = geocoder.GetResults();

            Console.WriteLine("Results count:" + results.Count);
            Assert.AreEqual(expectedResults, results.Count);
        }
Example #14
0
        public async Task ValidatesResultsAsync(string query, LanguageCode locale, string result)
        {
            var geocoder = new YandexGeocoder
            {
                Apikey       = API_KEY,
                SearchQuery  = query,
                Results      = 1,
                LanguageCode = locale
            };


            var results = geocoder.GetResultsAsync();

            Console.WriteLine((await results).First());
            StringAssert.Contains(result, (await results).First().AddressLine);
        }
Example #15
0
        private static void ProcessLine(string line, StreamWriter writer)
        {
            string[] chunks = line.Split(CSV_DELIMITER);

            if (IsLineValid(chunks))
            {
                string adress = chunks[6].Replace("г. ", "");
                string year   = chunks[7];

                GeoObjectCollection results = YandexGeocoder.Geocode(chunks[6], 1, LangType.ru_RU);
                if (results.Count() > 0)
                {
                    writer.WriteLine("{0},{1},{2},{3}", adress, year, results.First().Point.Lat, results.First().Point.Long);
                }
            }
        }
Example #16
0
        public void AssertConvertEnCulture()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo("ru-RU");
            //with this culture, convert from "1.01" will throw exception
            //Convert.ToDouble("1.01");

            var geocoder = new YandexGeocoder
            {
                SearchQuery  = "тверская 1",
                Results      = 1,
                LanguageCode = LanguageCode.ru_RU
            };

            var results = geocoder.GetResults();

            Console.WriteLine("Results count:" + results.Count);
        }
Example #17
0
        public void ValidatesCultureAndReadsApiFromEnv()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture =
                System.Globalization.CultureInfo.GetCultureInfo("ru-RU");

            Environment.SetEnvironmentVariable("YANDEX_GEOCODER_KEY", API_KEY);

            var geocoder = new YandexGeocoder
            {
                SearchQuery  = "тверская 1",
                Results      = 1,
                LanguageCode = LanguageCode.ru_RU
            };

            var results = geocoder.GetResults();

            Console.WriteLine("Results count:" + results.Count);
        }
Example #18
0
        static void Main(string[] args)
        {
            GoogleGeocoder googleGeocoder = new GoogleGeocoder();
            YandexGeocoder yandexGeocoder = new YandexGeocoder();

            RequestData request = new RequestData()
            {
                Address = "inönü mahallesi atatürk caddesi birlik apt. no:55 daire 7 istanbul ataşehir türkiye"
            };

            ResponseData googleResult = googleGeocoder.Geocode(request);

            List <GoogleResult> googleGeocodeResultList = googleGeocoder.GeocodeAndParse(request);

            ResponseData yandexResult = yandexGeocoder.Geocode(request);

            List <YandexResult> yandexGeocodeResultList = yandexGeocoder.GeocodeAndParse(request);
        }
        public IHttpActionResult PostGeoTag(GeoTag geotag)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Address             address      = geotag.Address;
            string              placeAddress = string.Format("{0} {1} {2} {3}", address.City, address.Street, address.HouseNumber, address.Housing);
            GeoObjectCollection results      = YandexGeocoder.Geocode(placeAddress);

            foreach (GeoObject result in results)
            {
                geotag.Point      = new Point();
                geotag.Point.Lat  = result.Point.Lat;
                geotag.Point.Long = result.Point.Long;
                db.GeoTags.Add(geotag);
                db.SaveChanges();

                return(CreatedAtRoute("DefaultApi", new { id = geotag.Id }, geotag));
            }

            return(BadRequest());
        }
Example #20
0
 public YandexGeocoderTests()
 {
     Geocoder = new YandexGeocoder();
 }
Example #21
0
        static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
            DateTime datetimeNow = DateTime.Now;

            DataTable dbTbl = new DataTable("houses71dd");

            OleDbConnection dbConn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\home91\Downloads\fias_dbf;Extended Properties=dBASE IV;");

            dbConn.Open();

            string whereString = "ADDROB71.POSTALCODE in ('300001','300004','300012','300026','300021','300016','300027','300010','300053')";

            if (args.Length > 0)
            {
                whereString = args[0];
            }
            string sqlSelect = $"select HOUSE71.HOUSEGUID, ADDROB71.PARENTGUID, ADDROB71.AOGUID, ADDROB71.FORMALNAME, ADDROB71.SHORTNAME, HOUSE71.HOUSENUM, ADDROB71.ENDDATE, HOUSE71.ENDDATE from ADDROB71, HOUSE71 where ADDROB71.AOGUID = HOUSE71.AOGUID and {whereString}";
            //string sqlSelect = $"select ADDROB71.PARENTGUID, ADDROB71.AOGUID, ADDROB71.FORMALNAME, ADDROB71.SHORTNAME, HOUSE71.HOUSENUM from ADDROB71, HOUSE71 where ADDROB71.AOGUID = HOUSE71.AOGUID and ADDROB71.ENDDATE > {datetimeNow.ToString("dd/MM/yyyy")} and HOUSE71.ENDDATE > {datetimeNow.ToString("dd/MM/yyyy")} and ADDROB71.POSTALCODE = '300057'";
            //string sqlSelect = $"select * from ADDROB71, HOUSE71 where ADDROB71.AOGUID = HOUSE71.AOGUID and ADDROB71.ENDDATE > {datetimeNow.ToString("MM/dd/yyyy")} and HOUSE71.ENDDATE > {datetimeNow.ToString("MM/dd/yyyy")} and ADDROB71.POSTALCODE = '300057'";
            //string sqlSelect = $"select * from ADDROB71, HOUSE71 where ADDROB71.AOGUID = HOUSE71.AOGUID and ADDROB71.ENDDATE > @value1 and HOUSE71.ENDDATE > @value1 and ADDROB71.POSTALCODE = '300057'";

            OleDbCommand dbComm = new OleDbCommand(sqlSelect, dbConn);
            //dbComm.Parameters.AddWithValue("@value1", datetimeNow);
            //dbComm.Parameters.AddWithValue("@value2", datetimeNow);
            OleDbDataAdapter dbAdap = new OleDbDataAdapter(dbComm);

            dbAdap.Fill(dbTbl);

            dbTbl.Columns.Add("ADDRFULL", typeof(String));
            dbTbl.Columns.Add("POINTLAT", typeof(Double));
            dbTbl.Columns.Add("POINTLNG", typeof(Double));

            Console.WriteLine($"Count {dbTbl.Rows.Count} rows from DB.");
            dbTbl.Rows.Cast <DataRow>().All(r =>
            {
                if (((DateTime)r["ADDROB71.ENDDATE"] < datetimeNow) || ((DateTime)r["HOUSE71.ENDDATE"] < datetimeNow))
                {
                    r.Delete();
                    Console.WriteLine($"{dbTbl.Rows.IndexOf(r)}/{dbTbl.Rows.Count} DELETE UNUSED");
                    return(true);
                }

                string SFN = $"{ GetShortAndFormalNames(dbConn, r["PARENTGUID"].ToString())}, {r["SHORTNAME"]} {r["FORMALNAME"]} {r["HOUSENUM"]}";

                var geocoder = new YandexGeocoder
                {
                    Apikey       = "a1d0badd-df1d-4814-8d43-eab723c50133",
                    SearchQuery  = SFN,
                    Results      = 1,
                    LanguageCode = LanguageCode.en_RU
                };

                var getRes = geocoder.GetResults();

                if (getRes.Count == 0)
                {
                    r.Delete();
                    Console.WriteLine($"{dbTbl.Rows.IndexOf(r)}/{dbTbl.Rows.Count} DELETE NO GEOCODE");
                    return(true);
                }

                LocationPoint pnt = getRes[0].Point;

                Console.WriteLine($"{dbTbl.Rows.IndexOf(r)}/{dbTbl.Rows.Count} {SFN} [ {pnt.Longitude}, {pnt.Latitude} ]");

                r["ADDRFULL"] = SFN;
                r["POINTLAT"] = pnt.Latitude;
                r["POINTLNG"] = pnt.Longitude;

                return(true);
            });

            dbTbl.AcceptChanges();
            Console.WriteLine($"Count {dbTbl.Rows.Count} rows is live.");

            //string TBLNAME_DISDUR = $"DISDUR{ datetimeNow.ToString("ddMMyyyy")}";
            string TBLNAME_DISDUR = Path.GetRandomFileName();
            {
                OleDbCommand cmd = dbConn.CreateCommand();

                //cmd.CommandText = $"CREATE TABLE {TBLNAME_DISDUR} (SRC_HOUSEGUID CHAR(36), DST_HOUSEGUID CHAR(36), DISTANCE DECIMAL, DURATION DECIMAL)";
                cmd.CommandText = $"CREATE TABLE {TBLNAME_DISDUR} (WHENQUERY DATETIME, SRC_LAT DECIMAL, SRC_LNG DECIMAL, DST_LAT DECIMAL, DST_LNG DECIMAL, DISTANCE DECIMAL, DURATION DECIMAL)";
                cmd.ExecuteNonQuery();
            }


            var osrm = new Osrm5x("http://router.project-osrm.org/", "v1", "car");

            //var result = osrm.Nearest(new Location(52.4224, 13.333086));
            //NearestResponse result = TryNearest(osrm);

            //result.Waypoints.All(w =>
            //{
            //    Console.WriteLine($"{w.Location.Longitude},{w.Location.Latitude}");
            //    return true;
            //});

            dbTbl.Rows.Cast <DataRow>().All(rowSrc =>
            {
                dbTbl.Rows.Cast <DataRow>().All(rowDst =>
                {
                    var locations = new Location[] {
                        new Location((Double)rowSrc["POINTLAT"], (Double)rowSrc["POINTLNG"]),
                        new Location((Double)rowDst["POINTLAT"], (Double)rowDst["POINTLNG"]),
                    };

                    var routeResult = TryRoute(osrm, locations);

                    Console.WriteLine($"{dbTbl.Rows.IndexOf(rowSrc)}/{dbTbl.Rows.IndexOf(rowDst)} {rowSrc["ADDRFULL"]} > {rowDst["ADDRFULL"]} DIS {routeResult.Routes[0].Distance} DUR {routeResult.Routes[0].Duration}");

                    if ((routeResult.Routes[0].Distance < 3000.0) && (routeResult.Routes[0].Duration < 600.0))
                    {
                        OleDbCommand cmd = dbConn.CreateCommand();

                        //cmd.CommandText = $"INSERT INTO {TBLNAME_DISDUR} VALUES ('{rowSrc["HOUSEGUID"]}', '{rowDst["HOUSEGUID"]}', {routeResult.Routes[0].Distance}, {routeResult.Routes[0].Duration})";
                        cmd.CommandText = $"INSERT INTO {TBLNAME_DISDUR} VALUES ({DateTime.Now.ToShortDateString()}, {(Double)rowSrc["POINTLAT"]}, {(Double)rowSrc["POINTLNG"]}, {(Double)rowDst["POINTLAT"]}, {(Double)rowDst["POINTLNG"]}, {routeResult.Routes[0].Distance}, {routeResult.Routes[0].Duration})";
                        cmd.ExecuteNonQuery();
                    }

                    return(true);
                });

                return(true);
            });

            dbConn.Close();
            dbConn.Dispose();

            dbTbl.WriteXml("house71dd.xml");
        }
Example #22
0
        static void Main(string[] args)
        {
            int NUMBER_OF_TWEETS_TO_READ = 5000;

            var filename = "";

            System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR");

            // these are the acces information for the Twitter Application that will pull data from Twitter API
            var userAccessToken  = ConfigurationManager.AppSettings["userAccessToken"];
            var userAccessSecret = ConfigurationManager.AppSettings["userAccessSecret"];

            // consumer key and secret may expire from time to time, remember to change them from app.config
            var userConsumerKey    = ConfigurationManager.AppSettings["userConsumerKey"];
            var userConsumerSecret = ConfigurationManager.AppSettings["userConsumerSecret"];

            // this is the twitter account to follow and geocode its tweets
            var twitterAccountToFollow = ConfigurationManager.AppSettings["twitterAccount"];

            var list = new List <TweetRecord>();

            TwitterCredentials.SetCredentials(userAccessToken, userAccessSecret, userConsumerKey, userConsumerSecret);
            var user = User.GetUserFromScreenName(twitterAccountToFollow);

            // create the API call parameter object
            var timelineParameter = Timeline.CreateUserTimelineRequestParameter(user.Id);

            timelineParameter.ExcludeReplies = true;
            timelineParameter.IncludeRTS     = false;
            timelineParameter.TrimUser       = false;
            timelineParameter.MaximumNumberOfTweetsToRetrieve = NUMBER_OF_TWEETS_TO_READ;

            // get the timeline tweets
            var timelineTweets = user.GetUserTimeline(timelineParameter);

            foreach (var tweet in timelineTweets)
            {
                // get a meaningful address chunk
                var address = getAddress(tweet.Text.ToLower());

                // try to geocode the given address
                double lat = 0, lng = 0;
                var    results = YandexGeocoder.Geocode(address, 1, LangType.tr_TR);
                if (results.Count() > 0)
                {
                    var point = results.First().Point;
                    lat = point.Lat;
                    lng = point.Long;

                    // if the lat/lng is negative, the address was not sucessfully parsed
                    // there should be a spatial check for country boundries for better error correction but still.
                    if (lat < 0 || lng < 0)
                    {
                        lat = 0;
                        lng = 0;
                    }
                    Console.WriteLine("[{0}] --- {1}:{2} ", tweet.Id, address, point.ToString());
                }
                list.Add(new TweetRecord
                {
                    Body    = tweet.Text,
                    Created = tweet.CreatedAt,
                    Id      = tweet.Id,
                    Lat     = lat,
                    Lng     = lng
                });
            }

            DumpToExcel(list, filename);
            Console.ReadLine();
        }