Beispiel #1
0
        public override DataSourceCategoryNode[] MakeDataSourceNode(System.IO.DirectoryInfo dir)
        {
            System.IO.FileInfo[] files = dir.GetFiles(m_strFilter);
            if (null == files || files.Length == 0)
            {
                return(null);
            }
            GeoStar.Kernel.ConnectProperty conn = new GeoStar.Kernel.ConnectProperty();
            conn.Server = dir.FullName;
            GeoStar.Kernel.GeoDatabase gdb = m_Fac.Open(conn);
            if (null == gdb)
            {
                return(null);
            }

            List <DataSourceCategoryNode> vList = new List <DataSourceCategoryNode>();

            foreach (var item in gdb.EnumDataRoomName(GeoStar.Kernel.DataRoomType.eFeatureClassType))
            {
                GeoStar.Kernel.FeatureClass vFeaClass = gdb.OpenDataRoom(GeoStar.Kernel.DataRoomType.eFeatureClassType, item) as GeoStar.Kernel.FeatureClass;
                vList.Add(new GeoStarFeatureClassDataSource(vFeaClass));
            }

            return(vList.ToArray());
        }
Beispiel #2
0
        NodeSource[] FindSHP(System.IO.DirectoryInfo dir)
        {
            System.IO.FileInfo[] files = dir.GetFiles("*.shp");
            if (files.Length == 0)
            {
                return(null);
            }
            List <NodeSource> vList = new List <NodeSource>();

            GeoStar.Kernel.ShpGeoDatabaseFactory fac  = new GeoStar.Kernel.ShpGeoDatabaseFactory();
            GeoStar.Kernel.ConnectProperty       conn = new GeoStar.Kernel.ConnectProperty();
            conn.Server = dir.FullName;
            GeoStar.Kernel.GeoDatabase gdb = fac.Open(conn);
            for (int i = 0; i < gdb.FeatureClassCount; i++)
            {
                vList.Add(new NodeSource(gdb.FeatureClassByIndex(i)));
            }
            return(vList.ToArray());
        }
Beispiel #3
0
        NodeSource[] FindGPKG(System.IO.DirectoryInfo dir)
        {
            System.IO.FileInfo[] files = dir.GetFiles("*.gpkg");
            if (files.Length == 0)
            {
                return(null);
            }
            GeoStar.Kernel.GeoPackageGeoDatabaseFactory fac = new GeoStar.Kernel.GeoPackageGeoDatabaseFactory();
            List <NodeSource> vList = new List <NodeSource>();

            foreach (var item in files)
            {
                GeoStar.Kernel.ConnectProperty conn = new GeoStar.Kernel.ConnectProperty();
                conn.Server = item.FullName;
                GeoStar.Kernel.GeoDatabase gdb = fac.Open(conn);
                if (null != gdb)
                {
                    vList.Add(new NodeSource(gdb));
                }
            }
            return(vList.ToArray());
        }
Beispiel #4
0
        public override DataSourceCategoryNode[] MakeDataSourceNode(System.IO.DirectoryInfo dir)
        {
            System.IO.FileInfo[] fileName = FindGPKG(dir);
            if (null == fileName || fileName.Length <= 0)
            {
                return(null);
            }

            GeoStar.Kernel.ConnectProperty conn  = new GeoStar.Kernel.ConnectProperty();
            List <DataSourceCategoryNode>  vList = new List <DataSourceCategoryNode>();

            foreach (var item in fileName)
            {
                conn.Server = item.FullName;
                GeoStar.Kernel.GeoDatabase gdb = m_Fac.Open(conn);
                if (null == gdb)
                {
                    continue;
                }
                vList.Add(new GeoDatabaseCategoryNode(gdb, item.Name));
            }
            return(vList.ToArray());
        }
Beispiel #5
0
        public override DataSourceCategoryNode[] MakeDataSourceNode(System.IO.DirectoryInfo dir)
        {
            List <DataSourceCategoryNode> vList = new List <DataSourceCategoryNode>();

            if (!ExistRaster(dir))
            {
                return(vList.ToArray());
            }
            GeoStar.Kernel.ConnectProperty conn = new GeoStar.Kernel.ConnectProperty();
            conn.Server = dir.FullName;
            GeoStar.Kernel.GeoDatabase gdb = m_Fac.Open(conn);
            foreach (var item in gdb.EnumDataRoomName(GeoStar.Kernel.DataRoomType.eRasterClassType))
            {
                GeoStar.Kernel.RasterClass c = gdb.OpenDataRoom(GeoStar.Kernel.DataRoomType.eRasterClassType, item)
                                               as GeoStar.Kernel.RasterClass;
                if (null == c)
                {
                    continue;
                }
                vList.Add(new GeoStarRasterClassDataSource(c));
            }
            return(vList.ToArray());
        }