欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

欢迎观看一起学习进步

程序员文章站 2022-05-22 09:45:57
...

Arc Engine 三维坡度坡向

第一次写博客,已经完成自己的二开大作业,之前坡度坡向在网上一直搜不到,也当是记录一下。

效果图

欢迎观看一起学习进步原Dem
欢迎观看一起学习进步
点击菜单栏的选项
欢迎观看一起学习进步坡度分析结果

欢迎观看一起学习进步坡向分析结果图
欢迎观看一起学习进步
在窗体放了一下下拉菜单可以选择和获取你选择的图层

坡向坡向代码如下

//坡度
IRasterLayer pRasterLayer = new RasterLayerClass();
                IGeoDataset pGeoDataset;
                int i = comboBox4.SelectedIndex;
                object zFactor;
                pRasterLayer = (IRasterLayer)mainMapControl.get_Layer(i);
                string layerN = mainMapControl.get_Layer(2).Name;
                IRaster pIRaster = pRasterLayer.Raster;
                ISurfaceOp pSurfaceOp = new RasterSurfaceOpClass();
                zFactor = 1;
               
                    pGeoDataset = pSurfaceOp.Slope((IGeoDataset)pIRaster, esriGeoAnalysisSlopeEnum.esriGeoAnalysisSlopeDegrees, ref zFactor);
                 
                    IRasterLayer pRasterLayer1 = new RasterLayerClass();

                    IRaster praster = new Raster();

                    praster = (IRaster)pGeoDataset;
                    ShowRasterResult(pGeoDataset, "坡度");
                    mainMapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
            axTOCControl1.Update();




//坡向
            IRasterLayer pRasterLayer = new RasterLayerClass();
            IGeoDataset pGeoDataset;
            int i = comboBox4.SelectedIndex;
            object zFactor;
            pRasterLayer = (IRasterLayer)mainMapControl.get_Layer(i);
            string layerN = mainMapControl.get_Layer(2).Name;
            IRaster pIRaster = pRasterLayer.Raster;
            ISurfaceOp pSurfaceOp = new RasterSurfaceOpClass();
            //zFactor = 1;

            pGeoDataset = pSurfaceOp.Aspect((IGeoDataset)pIRaster);

            IRasterLayer pRasterLayer1 = new RasterLayerClass();

            IRaster praster = new Raster();

            praster = (IRaster)pGeoDataset;
            ShowRasterResult(pGeoDataset, "坡向");
            mainMapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
            axTOCControl1.Update();
相关标签: 二次开发