Ejemplo n.º 1
0
        public static IEnumerable <IPixelBlock> PixelBlocks(this IRaster raster)
        {
            var cursor = raster.CreateCursor();

            while (cursor.Next())
            {
                yield return(cursor.PixelBlock);
            }
        }
Ejemplo n.º 2
0
        public void CanGetRasterFromMosaicDataset()
        {
            IWorkspace workspace = TestUtils.OpenUserWorkspaceOracle();

            IMosaicDataset dataset = DatasetUtils.OpenMosaicDataset(workspace,
                                                                    "TOPGIS_TLM.TLM_DTM_MOSAIC");

            IRaster raster = ((IMosaicDataset3)dataset).GetRaster(string.Empty);

            Assert.NotNull(dataset);

            IRasterCursor rasterCursor = raster.CreateCursor();

            IPixelBlock rasterCursorPixelBlock = rasterCursor.PixelBlock;

            Assert.NotNull(rasterCursorPixelBlock);
        }
Ejemplo n.º 3
0
        void GetRasterCursorDefault(IRaster pRaster)
        {
            IRasterCursor pRasterCursor = pRaster.CreateCursor();

             while (pRasterCursor.Next())
             {
                 IPixelBlock pPixBlock = pRasterCursor.PixelBlock;

                 int W = pPixBlock.Width;
                 //这个W也就是整个栅格数据记得宽度

                 int H = pPixBlock.Height;

             }
        }