Esempio n. 1
0
        /*
         * <Attribute text="产品类别" identify="SubProductIdentify" format="" visible="true"/>
         * <Attribute text="卫星" identify="Satellite" format="" visible="true"/>
         * <Attribute text="传感器" identify="Sensor" format="" visible="true"/>
         * <Attribute text="轨道时间" identify="OrbitDateTime" format="yyyy-MM-dd HH:mm:ss" visible="true"/>
         * <Attribute text="原始文件" identify="SourceFile" format="" visible="true"/>
         * <Attribute text="监测区域" identify="RegionIdentify" format="" visible="true"/>
         * <Attribute text="描述" identify="Description" format="" visible="true"/>
         * <Attribute text="轨道时间分组" identify="OrbitTimeGroup" format="yyyy-MM-dd" visible="true"/>
         * <Attribute text="文件名" identify="FileName" format="" visible="true"/>
         * <Attribute text="路径" identify="FileDir" format="" visible="true"/>
         * <Attribute text="类别中文" identify="CatalogItemCN" format="" visible="false"/>
         * <Attribute text="数据集定义" identify="CatalogDef" format="" visible="false"/>
         * <Attribute text="扩展信息" identify="ExtInfos" format="" visible="false"/>
         * <Attribute text="区域" identify="Region" format="" visible="false"/>
         * <Attribute text="轨道时间段" identify="OrbitTimes" format="yyyy-MM-dd HH:mm:ss ; yyyy-MM-dd HH:mm:ss" visible="false">
         */
        private void TryCreateInfoFromMainFile(string fname, string infoFileName, SubProductCatalogDef catalogDef)
        {
            string fileName = Path.GetFileNameWithoutExtension(fname);

            string[] parts = fileName.Split('_');
            if (parts.Length < 2)
            {
                return;
            }
            RasterIdentify  rst  = new RasterIdentify(fname);
            CatalogItemInfo info = new CatalogItemInfo();

            info.Properties.Add("ProductIdentify", parts[0]);
            info.Properties.Add("SubProductIdentify", parts[1]);
            info.Properties.Add("FileName", Path.GetFileName(fname));
            info.Properties.Add("FileDir", Path.GetDirectoryName(fname));
            info.Properties.Add("CatalogDef", catalogDef == null ? "" : catalogDef.ClassString);
            info.Properties.Add("Satellite", rst.Satellite);
            info.Properties.Add("Sensor", rst.Sensor);
            info.Properties.Add("OrbitDateTime", GetDateFormart(rst.OrbitDateTime, catalogDef, "OrbitDateTime"));
            info.Properties.Add("OrbitTimeGroup", GetDateFormart(rst.OrbitDateTime, catalogDef, "OrbitTimeGroup"));
            info.Properties.Add("CatalogItemCN", GetCatalogCN(info, MifEnvironment.CatalogItemCNDic));
            RasterIdentify ri = new RasterIdentify(fname);

            info.Properties.Add("Region", GetRegionInfo(ri, fname));
            info.Properties.Add("ExtInfos", GetExtInfo(ri, fname));
            info.Properties.Add("CycFlagCN", string.IsNullOrEmpty(ri.CYCFlag) ? "\\" : GetCycFlagCN(info, ri.CYCFlag, MifEnvironment.CatalogItemCNDic));
            info.Properties.Add("OrbitTimes", GetOrbitTimes(ri));
            //.....
            info.SaveTo(infoFileName);
            _info = info;
        }
Esempio n. 2
0
        public CatalogItem(string fname, CatalogItemInfo info)
        {
            _fileName = fname;
            string infoFileName = GetInfoFileName(fname);

            info.SaveTo(infoFileName);
            _info = info;
        }