コード例 #1
0
        public static BikeTheft ParseCSVRow(string[] row)
        {
            TextInfo format   = new CultureInfo("nl-NL", false).TextInfo;
            string   ID       = row[0];
            string   color    = format.ToTitleCase(row[24].ToLower());
            string   brand    = format.ToTitleCase(row[22].ToLower());
            DateTime dateTime = DateTime.ParseExact(row[11], "dd-MM-yy", CultureInfo.InvariantCulture);

            string         street   = format.ToTitleCase(row[9].ToLower());
            GoogleLocation location = GoogleGeocodeAPI.GetStreetAndDistrict(street + " Rotterdam");

            return(new BikeTheft(ID, location.Street, location.District, brand, color, dateTime));
        }
コード例 #2
0
        public static BikeContainer ParseCSVRow(string[] row)
        {
            TextInfo format    = new CultureInfo("nl-NL", false).TextInfo;
            string   ID        = row[0];
            DateTime dateTime  = DateTime.ParseExact(row[32], "dd-MM-yyyy", CultureInfo.InvariantCulture);
            Double   latCoord  = double.Parse(row[18]);
            Double   longCoord = double.Parse(row[19]);

            string         street   = format.ToTitleCase(row[9].ToLower());
            GoogleLocation location = GoogleGeocodeAPI.GetStreetAndDistrict(street + " Rotterdam");

            if (location.Validate())
            {
                return(new BikeContainer(ID, dateTime, location.Street, location.District, latCoord, longCoord));
            }

            return(null);
        }