コード例 #1
0
 private void readObjects()
 {
     rios = MapTools.readPolylines(@"C:\Users\Admin\Documents\projects\LostCity\georefObjects\rios.csv", false);
     //rios = MapTools.readGeoJSON(@"C:\Users\Admin\Documents\projects\LostCity\GISprocesses\whitebox proj1\PythonApplication1\WBT\data\test.geojson");
     //MapTools.writePolylines(rios, @"C:\Users\Admin\Documents\projects\LostCity\georefObjects\rivertest.csv");
     rioTree = setKDTreeFromPolylines(rios);
     caminos = MapTools.readPolylines(@"C:\Users\Admin\Documents\projects\LostCity\georefObjects\caminos.csv", false);
     getSitioData();
 }
コード例 #2
0
        private void getSitioData()
        {
            boundaries = MapTools.readPolylines(@"C:\Users\Admin\Documents\projects\LostCity\georefObjects\sitios.csv", true);
            StreamReader sr   = new StreamReader(@"C:\Users\Admin\Documents\projects\LostCity\georefObjects\sitioData.csv");
            string       line = sr.ReadLine();
            int          rank = 1;

            while (line != null)
            {
                string[] parts = line.Split(',');
                Sitio    s     = new Sitio();
                s.rank        = rank;
                s.name        = parts[0];
                s.area        = Convert.ToDouble(parts[1]);
                s.populationL = Convert.ToDouble(parts[2]);
                s.populationF = Convert.ToDouble(parts[3]);
                s.boundary    = boundaries.Find(x => x.name == s.name);
                sitios.Add(s);
                line = sr.ReadLine();
                rank++;
            }
            sr.Close();
        }