Пример #1
0
        public IList <RasterName> get_RasterDataSetNames()
        {
            IList <RasterName> names = new List <RasterName>();

            if (this.m_workSpace != null)
            {
                IEnumDatasetName   enumDatasetName   = m_workSpace.get_DatasetNames(esriDatasetType.esriDTRasterCatalog);
                IDatasetName       datasetName       = enumDatasetName.Next();//DataSet的名字
                IRasterWorkspaceEx rasterWorkspaceEx = m_workSpace as IRasterWorkspaceEx;
                while (datasetName != null)
                {
                    RasterName name = new RasterName();
                    name.RasDCName = datasetName.Name.ToString();
                    IRasterCatalogName rasterCaName  = (IRasterCatalogName)datasetName;
                    IRasterCatalog     rasterCatalog = rasterWorkspaceEx.OpenRasterCatalog(name.RasDCName);
                    ITable             table         = rasterCatalog as ITable;
                    ICursor            cursor        = table.Search(null, false);
                    IRow row = cursor.NextRow();
                    while (row != null)
                    {
                        name.RDSName.Add(row.get_Value(cursor.FindField("NAME")).ToString());

                        row = cursor.NextRow();
                    }
                    names.Add(name);
                    datasetName = enumDatasetName.Next();
                }
            }
            return(names);
        }
Пример #2
0
        public IList<RasterName> get_RasterDataSetNames()
        {
            IList<RasterName> names = new List<RasterName>();
            if (this.m_workSpace != null)
            {

                IEnumDatasetName enumDatasetName = m_workSpace.get_DatasetNames(esriDatasetType.esriDTRasterCatalog);
                IDatasetName datasetName = enumDatasetName.Next();//DataSet的名字
                IRasterWorkspaceEx rasterWorkspaceEx=m_workSpace as IRasterWorkspaceEx;
                while (datasetName != null)
                {
                    RasterName name = new RasterName();
                    name.RasDCName = datasetName.Name.ToString();
                    IRasterCatalogName rasterCaName = (IRasterCatalogName)datasetName;
                    IRasterCatalog rasterCatalog= rasterWorkspaceEx.OpenRasterCatalog(name.RasDCName);
                    ITable table = rasterCatalog as ITable;
                    ICursor cursor = table.Search(null,false);
                    IRow row = cursor.NextRow();
                    while(row != null)
                    {
                        name.RDSName.Add(row.get_Value(cursor.FindField("NAME")).ToString());

                        row = cursor.NextRow();
                    }
                    names.Add(name);
                    datasetName = enumDatasetName.Next();
                }
            }
            return names;
        }