Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            System.Threading.Thread newThread1 =
               new System.Threading.Thread(() => { connectionsList = CSVReader.readConnections(); });
            System.Threading.Thread newThread2 =
                new System.Threading.Thread(() => { eventsList = CSVReader.readEvents(); });
            System.Threading.Thread newThread3 =
                new System.Threading.Thread(() => { monitoringList = CSVReader.readMonitoring(); });
            System.Threading.Thread newThread4 =
                 new System.Threading.Thread(() => { positionsList = CSVReader.readPositions(); });

            newThread1.Start();
            newThread2.Start();
            newThread3.Start();
            newThread4.Start();
            newThread4.Join();

            MainClass mainclass = new MainClass();
            Converter converter = new Converter();
            mainclass.convertRijksdriehoek();

            System.Threading.Thread newThread5 =
               new System.Threading.Thread(converter.convertDateTimeConnections);
            System.Threading.Thread newThread6 =
                new System.Threading.Thread(converter.convertDateTimeEvents);
            System.Threading.Thread newThread7 =
                new System.Threading.Thread(converter.convertDateTimeMonitoring);
            System.Threading.Thread newThread8 =
                 new System.Threading.Thread(converter.convertDateTimePositions);

            newThread5.Start();
            newThread6.Start();
            newThread7.Start();
            newThread8.Start();

           

            _client = new MongoClient();
            _db = _client.GetDatabase("DatabaseCityGis");

            MainAsync(args).GetAwaiter().GetResult();
        }
Ejemplo n.º 2
0
        private void convertRijksdriehoek() {
            double rdX = 0;
            double rdY = 0;

            for (int i = 0; i < positionsList.Count; i++)
            {
                //Takes the Rdx / Rdy value from the object and casts it to a double
                CsvObjects.Positions obj = (CsvObjects.Positions)positionsList[i];
                rdX = double.Parse(obj.Rdx, CultureInfo.InvariantCulture);
                rdY = double.Parse(obj.Rdy, CultureInfo.InvariantCulture);
                //Console.WriteLine(i + " rdx casted:" + rdX + " rdy casted: " + rdY);
                
                //Calls the converter method, which converts it into Lattitude and Longitude and splits the results
                Converter converter = new Converter();
                string result = converter.ConvertToLatLong(rdX, rdY);
                string[] results = result.Split();
                //Console.WriteLine(i + " result 1: " + results[0] + " result 2: " + results[1]);

                //Puts the results into the variables in the object
                obj.Lattitude = results[0].ToString();
                obj.Longitude = results[1].ToString();
                //Console.WriteLine("latitude: " + obj.Lattitude + " longitude: " + obj.Longitude);
            }
            Console.WriteLine("done Converting Rijksdriehoek");

        }