在ESRI引擎应用程序(C#)中,如何添加带有图块和金字塔的栅格图层
我正在使用 ESRI,使用 C# 开发 Windows 窗体应用程序 我有一个包含 4 个图块的栅格图层,并且我为该图层创建了金字塔。 栅格图层位于文件夹“C:/Map”中,该文件夹包含其他8个子文件夹,名为“pyramid0_1”、“pyramid2_1”、“pyramid4_1”、“pyramid8_1”....“pyramid128_1” 我正在尝试将图层添加到地图控件,但是当尝试添加图层时,我只能成功地从一个金字塔级别添加它。
这是我的代码:
IWorkspaceFactory wf = new RasterWorkspaceFacoryClass();
IRasterWorkspace workspace = wf.OpenFromFile("C:/Map/pyramid0_1", 0)
IEnumDataset enumDS = workspace.get_Datasets(esriDatasetType.esriDTAny)
然后我迭代 enumDS(包含 4 个图层)并将每个图层添加到地图控件。
我尝试将发送到 wf.OpenFromFile() 的文件夹更改为“C:/Map”,但是当我尝试时,我得到的 enumDS 是空的。
有没有办法将整个栅格图层添加到地图控件中,并让 ESRI 进行计算并根据请求的比例为每次绘制使用正确的金字塔级别?
非常感谢您的帮助!
I'm using ESRI, working on a windows form applicaion using C#
I have a raster layer with 4 tiles, and I've created pyramids for this layer.
The raster layer is in the folder "C:/Map", this folder contains 8 other sub-folders, called "pyramid0_1", "pyramid2_1", "pyramid4_1", "pyramid8_1"...."pyramid128_1"
I'm trying to add the layer to a map control, but when trying to add the layer, I only succeed in adding it from one pyramid level.
This is my code:
IWorkspaceFactory wf = new RasterWorkspaceFacoryClass();
IRasterWorkspace workspace = wf.OpenFromFile("C:/Map/pyramid0_1", 0)
IEnumDataset enumDS = workspace.get_Datasets(esriDatasetType.esriDTAny)
I then iterate over the enumDS (which contain 4 layers) and add each layer to the map control.
I've tried changing the folder I send to wf.OpenFromFile() to "C:/Map", but when I tried it, the enumDS I got was empty.
Is there a way to add the entire raster layer to the map control, and let ESRI do their calculation and use the correct pyramid level for each draw according to the requested scale?
Thanks a lot for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论