Esempio n. 1
0
        private void BuildGrid()
        {
            WebMercatorGrid grid = new WebMercatorGrid();
            //
            List <Coordinate> coordinates = new List <Coordinate>();

            coordinates.Add(new Coordinate(109, 20));
            coordinates.Add(new Coordinate(117.2, 25.6));
            Bound bound = new Bound(coordinates);

            //构建尺度6格网
            for (int i = 10; i < 17; i++)
            {
                grid.Build(bound, i);
            }
            //shpfile路径
            string    shpPath   = System.IO.Directory.GetCurrentDirectory() + @"\DATA\shp\china\guangdong.shp";
            ShpReader shpReader = new ShpReader();

            shpReader.Read(shpPath);
            //
            string outputDir = System.IO.Directory.GetCurrentDirectory() + @"\dataset";

            grid.CutShape(shpReader.FeaureCollection, outputDir);
        }