예제 #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();
        }
예제 #3
0
        private void getIndices()
        {
            indicesForAnalysis = new List <List <int[]> >();
            for (int s = 0; s < sitios.Count; s++)
            {
                if (sitios[s].boundary != null)
                {
                    for (int i = 0; i < dem.ptsLonLat.Count; i++)
                    {
                        for (int j = 0; j < dem.ptsLonLat[i].Count; j++)
                        {
                            if (MapTools.isPointInPolygon(dem.ptsLonLat[i][j], sitios[s].boundary.vertices))
                            {
                                int[] index = { i, j };

                                sitios[s].gridPoints.Add(index);
                            }
                        }
                    }
                    indicesForAnalysis.Add(sitios[s].gridPoints);
                }
            }
        }