Esempio n. 1
0
        public IRaster GetClip(Extent e, double cellsize, string output)
        {
            currentExtent = e;

            this.cellsize = cellsize;

            AreaInterest a = new AreaInterest();

            a.Azimut = 0;
            a.CellSizeX = cellsize;
            a.CellSizeY = cellsize;
            a.MinX = e.MinX;
            a.MinY = e.MinY;
            a.MaxX = e.MaxX;
            a.MaxY = e.MaxY;

            double height = Math.Abs(e.MaxY - e.MinY);
            double width = Math.Abs(e.MaxX - e.MinX);
            int numberRows = Convert.ToInt32(Math.Ceiling(height / cellsize)) + 1;
            int numberCols = Convert.ToInt32(Math.Ceiling(width / cellsize)) + 1;

            IRaster raster;
            // this.np=this.Search.MaxNumPoints;
            CreateGridFromExtents(e, cellsize, poly.Projection, -9999, output, out raster);
            a.NumColumns = raster.NumColumns;
            a.NumRows = raster.NumRows;

            vector = new VectorGrid(a, null);

            //  vector.UpdateAreaInterestByCellSize();
            data = new double[vector.Get_area().NumColumns, vector.Get_area().NumRows];

            foreach (Feature fea in poly.Features)
            {
                InterceptLine(fea);
            }

            return Surface(raster);
        }
Esempio n. 2
0
        public IRaster GetClip(Extent e, double cellsize, string output)
        {
            currentExtent = e;

            if (test)
            {
                li = new FeatureSet(FeatureType.Line);
                li.Projection = poly.Projection;
                li.DataTable.Columns.Add(new System.Data.DataColumn("id"));
            }

            this.cellsize = cellsize;


            AreaInterest a = new AreaInterest();

            a.Azimut = 0;
            a.CellSizeX = cellsize;
            a.CellSizeY = cellsize;
            a.MinX = e.MinX;
            a.MinY = e.MinY;
            a.MaxX = e.MaxX;
            a.MaxY = e.MaxY;

            IRaster raster;
            // this.np=this.Search.MaxNumPoints;
            CreateGridFromExtents(e, cellsize, poly.Projection, -9999, output, out raster);
            a.NumColumns = raster.NumColumns;
            a.NumRows = raster.NumRows;
            vector = new VectorGrid(a, null);
            //  vector.UpdateAreaInterestByCellSize();
            data = new double[vector.Get_area().NumColumns, vector.Get_area().NumRows];

            foreach (Feature fea in poly.Features)
            {
                InterceptLine(fea);
            }

            if (test)
                li.SaveAs("c:\\temp\\Lakelines.shp", true);

            return Surface(raster);


        }