zoukankan      html  css  js  c++  java
  • ArcGIS Pro二次开发-获得一个栅格

    /// <summary>
    
            /// Open a Raster Dataset given a folder and a dataset name.
    
            /// </summary>
    
            /// <param name="folder">Full path to the folder containing the raster dataset.</param>
    
            /// <param name="name">Name of the raster dataset to open.</param>
    
            /// <returns></returns>
    
            public static RasterDataset OpenRasterDataset(string folder, string name)
    
            {
    
                // Create a new raster dataset which is set to null
    
                RasterDataset rasterDatasetToOpen = null;
    
                try
    
                {
    
                    // Create a new file system connection path to open raster datasets using the folder path.
    
                    FileSystemConnectionPath connectionPath = new FileSystemConnectionPath(new System.Uri(folder), FileSystemDatastoreType.Raster);
    
                    // Create a new file system data store for the connection path created above.
    
                    FileSystemDatastore dataStore = new FileSystemDatastore(connectionPath);
    
                    // Open the raster dataset.
    
                    rasterDatasetToOpen = dataStore.OpenDataset<RasterDataset>(name);
    
                    // Check if it is not null. If it is show a message box with the appropriate message.
    
                    if (rasterDatasetToOpen == null)
    
                        MessageBox.Show("Failed to open raster dataset: " + name);
    
                }
    
                catch (Exception exc)
    
                {
    
                    // If an exception occurs, show a message box with the appropriate message.
    
                    MessageBox.Show("Exception caught in OpenRasterDataset for raster: " + name + exc.Message);
    
                }
    
                return rasterDatasetToOpen;
    
            }
  • 相关阅读:
    iptables单独记录一个日志文件
    centos7安装kvm
    查看一个启动的程序安装位置
    mysql-audit
    select 导出数据以|分割
    Codeforces 1105E 最大独立集 状态DP 中途相遇法
    Codeforces 1140E DP
    Codeforces 1152D DP
    GYM 101933E 状态压缩 + 记忆化搜索
    Codeforces 1151E 统计贡献
  • 原文地址:https://www.cnblogs.com/gisoracle/p/12467949.html
Copyright © 2011-2022 走看看