コード例 #1
0
        public string AddToWorkspace(IWorkspace wks)
        {
            if (_currentProduct == null || _currentSubProduct == null || wks == null)
            {
                return(null);
            }
            ICatalog            c      = wks.GetCatalog("CurrentExtracting");
            string              name   = GetName(_currentProduct, _currentSubProduct);
            IPixelIndexMapper   result = _resultObjects[name].BinaryValues;
            IRasterDataProvider prd    = GetRasterDataProvider(_canvasViewer);

            if (prd == null)
            {
                return(null);
            }
            RasterIdentify rstIdentify = GetRasterIdentify(prd);
            string         fname       = InterestedRaster <Int16> .GetWorkspaceFileName(rstIdentify);

            if (File.Exists(fname))
            {
                //GeoDo.RSS.UI.AddIn.Theme.AutoGeneratorSettings.enumActionOfExisted action = GetActionOfFileIsExisted(fname);
                //if (action == AutoGeneratorSettings.enumActionOfExisted.Overide)
                //{
                try
                {
                    fname = WriteInterestedRaster(result, prd, rstIdentify, fname);
                }
                catch (Exception e)
                {
                    MsgBox.ShowError(e.Message);
                }
                //}
                //else if (action == AutoGeneratorSettings.enumActionOfExisted.ReName)
                //{
                //    fname = fname.Replace(".dat", DateTime.Now.ToString("_yyyyMMddHHmmss") + ".dat");
                //    using (IInterestedRaster<Int16> rst = new InterestedRaster<Int16>(fname,
                //        new Size(prd.Width, prd.Height), prd.CoordEnvelope.Clone()))
                //    {
                //        rst.Put(result.Indexes.ToArray(), 1);
                //    }
                //}
                //else if (action == AutoGeneratorSettings.enumActionOfExisted.Skip)
                //{
                //}
            }
            else
            {
                fname = WriteInterestedRaster(result, prd, rstIdentify, fname);
            }
            //
            c.AddItem(new CatalogItem(fname, wks.GetCatalogByIdentify(rstIdentify.SubProductIdentify).Definition as SubProductCatalogDef));
            return(fname);
        }
コード例 #2
0
        protected string FindCloudExtractResult(string inputFileName)
        {
            string         dirName     = Path.Combine(MifEnvironment.GetWorkspaceDir(), "VGT");
            RasterIdentify rstIdentify = GetRasterIdentify(inputFileName);
            string         fname       = InterestedRaster <Int16> .GetWorkspaceFileName(rstIdentify);

            string[] cloudFiles = Directory.GetFiles(dirName, Path.GetFileName(fname), SearchOption.AllDirectories);
            if (cloudFiles != null && cloudFiles.Length > 0)
            {
                return(cloudFiles[0]);
            }
            else
            {
                return(null);
            }
        }