ImageVerifierCode 换一换
格式:DOC , 页数:27 ,大小:124.50KB ,
资源ID:6269159      下载积分:10 金币
快捷注册下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/6269159.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请

   平台协调中心        【在线客服】        免费申请共赢上传

权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。

注意事项

本文(AE的raster处理.doc)为本站上传会员【pc****0】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

AE的raster处理.doc

1、 1、栅格数据的存储类型 栅格数据一般可以存储为ESRI GRID(由一系列文件组成),TIFF格式(包括一个TIF文件和一个AUX文件),IMAGINE Image格式 在AE中一般调用ISaveAs接口来保存栅格数据 2、栅格数据集和栅格编目的区别 一个栅格数据集由一个或者多个波段(RasterBand)的数据组成,一个波段就是一个数据矩阵。对于格网数据(DEM数据)和单波段的影像数据,表现为仅仅只有一个波段数据的栅格数据集,而对于多光谱影像数据则表现为具有多个波段的栅格数据集 栅格编目(RasterCatalog)用于显示某个研究区域内各种相邻的栅格数据,这些相

2、邻的栅格数据没有经过拼接处理合成一副大的影像图 3、IRasterWorkspaceEx与IRasterWorkspace ,IRsterWorkspace2的区别 1).IRasteWorkspaceEx接口主要是用来读取GeoDatabase中的栅格数据集和栅格编目 2) . IRasterWorkspace ,IRsterWorkspace2主要是用来读取以文件格式存储在本地的栅格数据 4、加载栅格数据(以存储在本地的栅格数据文件为例) 1.直接用IRasterLayer接口打开一个栅格文件并加载到地图控件 IRasterLayer rasterLay

3、er = new RasterLayerClass(); rasterLayer.CreateFromFilePath(fileName); // fileName指存本地的栅格文件路径 axMapControl1.AddLayer(rasterLayer, 0); 2. 用IRasterDataset接口打开一个栅格数据集 IWorkspaceFactory workspaceFactory = new RasterWorkspaceFactory(); IWorkspace workspace; workspace = workspaceFactory.

4、OpenFromFile(inPath, 0); //inPath栅格数据存储路径 if (workspace == null) { Console.WriteLine("Could not open the workspace."); return; } IRasterWorkspace rastWork = (IRasterWorkspace)workspace; IRasterDataset rastDataset; rastDataset= rastWork.OpenRasterDataset(inName);//inName栅格文件名

5、 if (rastDataset == null) { Console.WriteLine("Could not open the raster dataset."); return; } 5、如何读取栅格数据的属性和遍历栅格数据 栅格数据的属性包括栅格大小,行数,列数,投影信息,栅格范围等等,见下面代码 (假设当前加载的栅格文件栅格值存储方式为:UShort类型) IRasterProps rasterProps = (IRasterProps)clipRaster; int dHeight = rasterProps.Height;

6、//当前栅格数据集的行数 int dWidth = rasterProps.Width; //当前栅格数据集的列数 double dX = rasterProps.MeanCellSize().X; //栅格的宽度 double dY = rasterProps.MeanCellSize().Y; //栅格的高度 IEnvelope extent=rasterProps.Extent; //当前栅格数据集的范围 rstPixelType pixelType=rasterProps.PixelType; //当前栅格像素类型 IPnt pntSize =

7、new PntClass(); pntSize.SetCoords(dX, dY); IPixelBlock pixelBlock = clipRaster.CreatePixelBlock(pntSize); IPnt pnt = new PntClass(); for (int i = 0; i < dHeight; i++) for (int j = 0; j < dWidth; j++) { pnt.SetCoords(i, j); clipRaster.Read(pnt, pixelBlock); if (pixelBlock !

8、 null) { object obj = pixelBlock.GetVal(0, 0, 0); MessageBox.Show( Convert.ToUInt32(obj).ToString()); } } 6、如何提取指定的范围的栅格数据 提取指定范围内的栅格数据通常用两种方法IRasterLayerExport(esriCarto), IExtractionOp, IExtractionOp2 (esriSpatialAnalyst),IRasterLayerExport接口提供的栅格数据提取功能有限,只能以矩形范围作为提取范围,而IExtr

9、actionOp接口提供了多边形,圆,属性,矩形等几种形式作为提取栅格数据. 1).IRasterLayerExport接口 IRasterLayerExport rLayerExport = new RasterLayerExportClass(); rLayerExport.RasterLayer = rasterLayer;// rasterLayer指当前加载的栅格图层 rLayerExport.Extent = clipExtent;//clipExtent指提取栅格数据的范围 if (proSpatialRef != null) rLayerEx

10、port.SpatialReference = proSpatialRef;// proSpatialRef当前栅格数据的投影信息 IWorkspaceFactory pWF = new RasterWorkspaceFactoryClass(); try { IWorkspace pRasterWorkspace = pWF.OpenFromFile(_folder, 0);// _folder指栅格文件保存路径 IRasterDataset outGeoDataset = rLayerExport.Export(pRasterWorkspace, code,

11、strRasterType); //调用ISaveAs接口将导出的数据集保存 …………………….. } Catch(Exception ex) { Throw new Argumention(ex.Message); } 2.IExtractionOp接口(调用此接口前,应该先检查空间许可) IExtractionOp extraction = new RasterExtractionOpClass(); try { IGeoDataset geoDataset = extraction.Rectangle((IGeoDa

12、taset)clipRaster, clipExtent, true); IRaster raster = geoDataset as IRaster; if (raster != null) { IWorkspaceFactory WF = new RasterWorkspaceFactoryClass(); IWorkspace rasterWorkspace = WF.OpenFromFile(_folder, 0); ISaveAs saveAs = (ISaveAs)raster; saveAs.SaveAs(“Result.tif”, ra

13、sterWorkspace, "TIFF"); } } catch (Exception ex) { MessageBox..Show(Ex.message); } 6.2如何创建一个栅格数据 public IRasterDataset CreateFileRasterDataset(string directoryName, string fileName)         {             // This function creates a new img file in the given workspace         

14、    // and then assigns pixel values             try             {                 IRasterDataset rasterDataset = null;                 IPoint originPoint = new PointClass();                 originPoint.PutCoords(0, 0);                 // Create the dataset                 IRasterWorkspace2 r

15、asterWorkspace2 = null;                 rasterWorkspace2 = CreateRasterWorkspace(directoryName);                 rasterDataset = rasterWorkspace2.CreateRasterDataset(fileName, "IMAGINE Image", originPoint, 200, 100, 1, 1, 1, rstPixelType.PT_UCHAR, new UnknownCoordinateSystemClass(), true);       

16、          IRawPixels rawPixels = null; //之后他代表第一波段(实际只有一个波段)纵横代码                 IPixelBlock3 pixelBlock3 = null; //承载栅格影像数据的块(内存块吗。。)                 IPnt pixelBlockOrigin = null;                 IPnt pixelBlockSize = null;                 IRasterBandCollection rasterBandCollection;           

17、      IRasterProps rasterProps;                   // QI for IRawPixels and IRasterProps                 rasterBandCollection = (IRasterBandCollection)rasterDataset;                 rawPixels = (IRawPixels)rasterBandCollection.Item(0);                 rasterProps = (IRasterProps)rawPixels;    

18、               // Create pixelblock 创建像素块                 pixelBlockOrigin = new DblPntClass();                 pixelBlockOrigin.SetCoords(0, 0);                 pixelBlockSize = new DblPntClass();                 pixelBlockSize.SetCoords(rasterProps.Width, rasterProps.Height);                 

19、pixelBlock3 = (IPixelBlock3)rawPixels.CreatePixelBlock(pixelBlockSize); // 上述函数为参数为IPnt Size,返回值为IPixelBlock                 // Read pixelblock 读取像素块,虽然它是由rawPixels创造的                 rawPixels.Read(pixelBlockOrigin, (IPixelBlock)pixelBlock3);                 // Get pixeldata array            

20、     System.Object[,] pixelData;                 pixelData = (System.Object[,])pixelBlock3.get_PixelDataByRef(0); //参数int plane                 // Loop through all the pixels and assign value                 for (int i = 0; i < rasterProps.Width; i++)                     for (int j = 0; j < rast

21、erProps.Height; j++)                         pixelData[i, j] = (i * j) % 255;                   // Write the pixeldata back                 System.Object cachePointer;                 cachePointer = rawPixels.AcquireCache();                 rawPixels.Write(pixelBlockOrigin, (IPixelBlock)pixelB

22、lock3);                 rawPixels.ReturnCache(cachePointer);                 // Return raster dataset                 return rasterDataset;             }             catch (Exception ex)             {                 System.Diagnostics.Debug.WriteLine(ex.Message);                 return null

23、             }         }           public IRasterWorkspace2 CreateRasterWorkspace(string pathName)         {             // Create RasterWorkspace             IWorkspaceFactory workspaceFactory = new RasterWorkspaceFactoryClass();             return workspaceFactory.OpenFromFile(pathName, 0

24、) as IRasterWorkspace2;         } 6.3依旧是生成栅格文件 public IRasterDataset CreateRasterDataset(string Path, string FileName) { try { //Create raster workspace. This example also works with any other workspaces that support raster data such as

25、a file geodatabase (FGDB) workspace. //Access the workspace and the SDE workspace. IRasterWorkspace2 rasterWs = OpenRasterWorkspace(Path); //Define the spatial reference of the raster dataset. ISpatialReference sr = new UnknownCoord

26、inateSystemClass(); //Define the origin for the raster dataset, which is the lower left corner of the raster. IPoint origin = new PointClass(); origin.PutCoords(15.0, 15.0); //Define the dimension of the raster dataset.

27、 int width = 100; //This is the width of the raster dataset. int height = 100; //This is the height of the raster dataset. double xCell = 30; //This is the cell size in x direction. double yCell = 30; //This is the cell size in y direction.

28、 int NumBand = 1; // This is the number of bands the raster dataset contains. //Create a raster dataset in grid format. IRasterDataset rasterDataset = rasterWs.CreateRasterDataset(FileName, "GRID", origin, width, height, xCell, yCell

29、 NumBand, rstPixelType.PT_UCHAR, sr, true); //Get the raster band. IRasterBandCollection rasterBands = (IRasterBandCollection)rasterDataset; IRasterBand rasterBand; IRasterProps rasterProps; ra

30、sterBand = rasterBands.Item(0); rasterProps = (IRasterProps)rasterBand; //Set NoData if necessary. For a multiband image, NoData value needs to be set for each band. rasterProps.NoDataValue = 255; //Create a raster from the dataset.

31、 IRaster raster = rasterDataset.CreateDefaultRaster(); //Create a pixel block. IPnt blocksize = new PntClass(); blocksize.SetCoords(width, height); IPixelBlock3 pixelblock = raster.CreatePixelBlock(blocksize) as I

32、PixelBlock3; //Populate some pixel values to the pixel block. System.Array pixels; pixels = (System.Array)pixelblock.get_PixelData(0); for (int i = 0; i < width; i++) for (int j = 0; j < height; j++)

33、 if (i == j) pixels.SetValue(Convert.ToByte(255), i, j); else pixels.SetValue(Convert.ToByte((i * j) / 255), i, j); pixelblock.set_PixelData(0, (System.Array)pixels);

34、 //Define the location that the upper left corner of the pixel block is to write. IPnt upperLeft = new PntClass(); upperLeft.SetCoords(0, 0); //Write the pixel block. IRasterEdit rasterEdit = (IRasterEdit)raster;

35、 rasterEdit.Write(upperLeft, (IPixelBlock)pixelblock); //Release rasterEdit explicitly. System.Runtime.InteropServices.Marshal.ReleaseComObject(rasterEdit); return rasterDataset; } catch (Exception ex) {

36、 System.Diagnostics.Debug.WriteLine(ex.Message); return null; } } public IRasterWorkspace2 OpenRasterWorkspace(string PathName) { //This function opens a raster workspace. try {

37、 IWorkspaceFactory workspaceFact = new RasterWorkspaceFactoryClass(); return workspaceFact.OpenFromFile(PathName, 0) as IRasterWorkspace2; } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message);

38、 return null; } } 来自http://bbs.esrichina- 7.栅格数据重采样 栅格数据的重采样主要基于三种方法:最邻近采样(NEAREST),双线性 ILINEAR)和三次卷积采样(CUBIC)。 (1).最邻近采样:它用输入栅格数据中最临近栅格值作为输出值。因此,在重采 样后的输出栅格中的每个栅格值, 都是输入栅格数据中真实存在而未加任何改变的值。这种方法简单易用,计算量小,重采样的速度最快。 (2).双线性采样:此重采样法取待采样点(x,y)点周围四个邻点,在y方向(或X

39、方向)内插两次,再在x方向(或y方向)内插一次,得到(x,y)点的栅格值。 (3).三次卷积采样:这是进一步提高内插精度的一种方法。它的基本思想是增加邻点来获 得最佳插值函数。取待计算点周围相邻的16个点,与双线性采样类似,可先在某一方向上内插,如先在x方向上,每四个值依次内插四次,再根据四次的计算结果在y方上内插,最终得到内插结果 代码示例:采用双线性采样 IRasterGeometryProc rasterGeometryProc = new RasterGeometryProcClass(); rasterGeometryProc.Resample(rstR

40、esamplingTypes.RSP_CubicConvolution, newCellSize, clipRaster); 栅格数据重分类 (2009-01-10 10:10:09) 标签:栅格 重分类 分类:AE二次开发 public static IRasterLayer SetViewShedRenderer(IRaster pInRaster,string sField,string sPath) { IRasterDescriptor pRD = new RasterDescriptorClass(); pRD.Create(pInRaste

41、r, new QueryFilterClass(), sField); IReclassOp pReclassOp = new RasterReclassOpClass(); IGeoDataset pGeodataset=pInRaster as IGeoDataset; IRasterAnalysisEnvironment pEnv = pReclassOp as IRasterAnalysisEnvironment; IWorkspaceFactory pWSF=new RasterWorkspaceFactoryClass(); IWorkspace pWS = p

42、WSF.OpenFromFile(sPath, 0); pEnv.OutWorkspace = pWS; object objSnap = null; object objExtent = pGeodataset.Extent; pEnv.SetExtent(esriRasterEnvSettingEnum.esriRasterEnvValue, ref objExtent, ref objSnap); pEnv.OutSpatialReference = pGeodataset.SpatialReference; IRasterLayer pRLayer = new

43、RasterLayerClass(); IRasterBandCollection pRsBandCol = pGeodataset as IRasterBandCollection; IRasterBand pRasterBand = pRsBandCol.Item(0); pRasterBand.ComputeStatsAndHist(); IRasterStatistics pRasterStatistic = pRasterBand.Statistics; double dMaxValue = pRasterStatistic.Maximum ; double

44、dMinValue = pRasterStatistic.Minimum ; INumberRemap pNumRemap = new NumberRemapClass(); pNumRemap.MapRange(dMinValue, 0, 0); pNumRemap.MapRange(0, dMaxValue, 1); IRemap pRemap = pNumRemap as IRemap; IRaster pOutRaster = pReclassOp.ReclassByRemap(pGeodataset, pRemap, false) as IRaster ;

45、 pRLayer.CreateFromRaster(pOutRaster); return pRLayer; } 栅格图层和矢量图层的属性表浏览 if (pLyr is IFeatureLayer) { DataTable pTable = new DataTable(); IFeatureLayer pFealyr = pLyr as IFeatureLayer; IFeatureClass pFCls = pFealyr.FeatureClass; string shape = ""; if (pFCls.ShapeType == es

46、riGeometryType.esriGeometryPoint) shape = "Point"; else if (pFCls.ShapeType == esriGeometryType.esriGeometryPolyline) shape = "Polyline"; else if (pFCls.ShapeType == esriGeometryType.esriGeometryPolygon) shape = "Polygon"; for (int i = 0; i < pFCls.Fields.FieldCount; i++) { pTable.

47、Columns.Add(pFCls.Fields.get_Field(i).Name); } IFeatureCursor pCursor = pFCls.Search(null, false); int ishape = pFCls.Fields.FindField("Shape"); IFeature pFea = pCursor.NextFeature(); while (pFea != null) { DataRow pRow = pTable.NewRow(); for (int i = 0; i < pFCls.Fields.FieldCount;

48、i++) { if (i == ishape) { pRow[i] = shape; continue; } pRow[i] = pFea.get_Value(i).ToString(); } pTable.Rows.Add(pRow); pFea = pCursor.NextFeature(); } dataGridView1.DataSource = pTable; } else if (pLyr is IRasterLayer) { IRasterLayer pRlyr = pLyr as IRasterLayer; I

49、Raster pRaster = pRlyr.Raster; IRasterProps pProp = pRaster as IRasterProps; pProp.PixelType = rstPixelType.PT_LONG; if (pProp.PixelType == rstPixelType.PT_LONG) { IRasterBandCollection pBcol = pRaster as IRasterBandCollection; IRasterBand pBand = pBcol.Item(0); ITable pRTable = pBand.AttributeTable; DataTable pTable = new DataTable(); for (int i = 0; i < pRTable.Fields.FieldCount; i++) pTable.Columns.Add(pRTable.Fields.get_Field(i).Name); ICursor pCursor= pRTable.Search(null, false); IRow pRrow= pCursor.NextRow(); while (pRrow !=

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服