Ejemplo n.º 1
0
        private void PrjNOAA(string file)
        {
            IRasterDataProvider srcRaster = null;

            try
            {
                Stopwatch stopwatch = new Stopwatch();
                stopwatch.Start();
                IFileProjector proj = FileProjector.GetFileProjectByName("NOAA_1BD");
                srcRaster = GetSrcRaster(file);
                NOAA_PrjSettings prjSetting = new NOAA_PrjSettings();
                prjSetting.OutPathAndFileName = GetOutPutFile(file);
                ISpatialReference dstSpatialRef = SpatialReference.GetDefault();
                proj.Project(srcRaster, prjSetting, dstSpatialRef, _progressCallback);
                stopwatch.Stop();
                WriteLine("数据投影{0}ms", stopwatch.ElapsedMilliseconds);
                //MessageBox.Show("投影输出文件" + prjSetting.OutPathAndFileName);
            }
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message);
            //}
            finally
            {
                if (srcRaster != null)
                {
                    if (srcRaster.BandProvider != null)
                    {
                        srcRaster.BandProvider.Dispose();
                    }
                    srcRaster.Dispose();
                }
                GC.Collect();
            }
        }
Ejemplo n.º 2
0
        private FilePrjSettings GetPrjSetting(IRasterDataProvider srcRaster)
        {
            string           dstFilename = @"D:\masData\noaa_1bd\testtt.ldf";
            PrjEnvelope      dstEnvelope = PrjEnvelope.CreateByCenter(78.621416, 32.189639, 36.00, 26.00);
            NOAA_PrjSettings prjSetting  = new NOAA_PrjSettings();

            prjSetting.OutPathAndFileName = dstFilename;    //必填
            //prjSetting.OutResolutionX = 1000F;     //default
            //prjSetting.OutResolutionY = 1000F;     //default
            //prjSetting.OutFormat = "LDF";          //default
            //prjSetting.OutEnvelope = dstEnvelope;  //default
            prjSetting.IsRadiation   = true;        //default true
            prjSetting.IsSolarZenith = true;
            return(prjSetting);
        }