Beispiel #1
0
        public override string[] Process(IGeographicPoint leftUpper, IGeographicPoint rigthLower, string dataFolder,
                                         string resultFolder)
        {
            var folderDescription = new LandsatDataDescription(dataFolder);

            var                  path             = folderDescription;
            LandsatMetadata      metadataFile     = JsonHelper.Deserialize <LandsatMetadata>(folderDescription.MetadataMtlJson);
            TirsThermalConstants thermalConstants = metadataFile.L1MetadataFile.TirsThermalConstants;
            var                  cuttedImageInfo  =
                ClipImageHelper.GetCuttedImageInfoByPolygon(folderDescription.Channel10.Raw,
                                                            new GeographicPolygon
            {
                UpperLeft  = leftUpper,
                LowerRight = rigthLower
            });

            using (var ds = Gdal.Open(folderDescription.Channel10.Raw, Access.GA_ReadOnly))
            {
                CalculateTemperature(ds.GetRasterBand(1),
                                     metadataFile.L1MetadataFile.RadiometricRescaling.RadianceMultBand11,
                                     metadataFile.L1MetadataFile.RadiometricRescaling.RadianceAddBand11,
                                     thermalConstants.K1ConstantBand11,
                                     thermalConstants.K2ConstantBand11,
                                     resultFolder,
                                     cuttedImageInfo
                                     );
            }

            return(new[] { resultFolder + "\\temperature.png" });
        }
 public GeographicPolygon()
 {
     UpperLeft  = new GeographicPoint();
     UpperRight = new GeographicPoint();
     LowerRight = new GeographicPoint();
     LowerLeft  = new GeographicPoint();
 }
        public override string[] Process(IGeographicPoint leftUpper, IGeographicPoint rigthLower, string dataFolder,
                                         string resultFolder)
        {
            var landsatDecription = new LandsatDataDescription(dataFolder);
            var cuttedImageInfo   =
                ClipImageHelper.GetCuttedImageInfoByPolygon(landsatDecription.Channel5.Raw,
                                                            new GeographicPolygon
            {
                UpperLeft  = leftUpper,
                LowerRight = rigthLower
            });


            try
            {
                string[] filePaths = Directory.GetFiles(@"C:\diplom\EMS.net\EMS\Services\CharacterizationService\CharacterizationService\Content");
                File.Copy(filePaths.Where(x => x.Contains("NDWI_legend.png")).First(), resultFolder + "\\NDWI_legend.png");
            }
            catch (Exception e)
            {
                Console.WriteLine("Файл уже существует");
            }

            CalculateNDWI(landsatDecription.Channel5.Normalized, landsatDecription.Channel6.Normalized,
                          cuttedImageInfo, resultFolder);

            return(new[] { resultFolder + "\\ndwi.png" });
        }
        public SrtmDataset(IGeographicPoint leftUpper, IGeographicPoint rigthLower, string folder)
        {
            _leftUpper  = leftUpper;
            _rigthLower = rigthLower;
            _folder     = folder;

            FormSrtmGrid();
            FillData();
        }
        public override string[] Process(IGeographicPoint leftUpper, IGeographicPoint rigthLower, string dataFolder, string resultFolder)
        {
            LandsatDataDescription landsatDescription = new LandsatDataDescription(dataFolder);

            CuttedImageInfo cuttedImageInfo =
                ClipImageHelper.GetCuttedImageInfoByPolygon(landsatDescription.Channel4.Raw,
                                                            new GeographicPolygon
            {
                UpperLeft  = leftUpper,
                LowerRight = rigthLower
            });

            string resultFileName;
            string redChannelFileName;
            string blueChannelFileName;
            string greenChannelFileName;

            switch (_characteristicType)
            {
            case CharacteristicType.Channels543:
            {
                redChannelFileName   = landsatDescription.Channel5.Normalized;
                greenChannelFileName = landsatDescription.Channel4.Normalized;
                blueChannelFileName  = landsatDescription.Channel3.Normalized;
                resultFileName       = resultFolder + "5-4-3.jpg";
                break;
            }

            case CharacteristicType.Channels753:
            {
                redChannelFileName   = landsatDescription.Channel7.Normalized;
                greenChannelFileName = landsatDescription.Channel5.Normalized;
                blueChannelFileName  = landsatDescription.Channel3.Normalized;
                resultFileName       = resultFolder + "7-5-3.jpg";
                break;
            }

            case CharacteristicType.Channels432:
            case CharacteristicType.Unknown:
            default:
            {
                redChannelFileName   = landsatDescription.Channel4.Normalized;
                greenChannelFileName = landsatDescription.Channel3.Normalized;
                blueChannelFileName  = landsatDescription.Channel2.Normalized;
                resultFileName       = resultFolder + "4-3-2.jpg";
                break;
            }
            }

            DrawLib.DrawNaturalColor(redChannelFileName
                                     , greenChannelFileName
                                     , blueChannelFileName,
                                     cuttedImageInfo, resultFileName);

            return(new string[] { resultFileName });
        }
Beispiel #6
0
        public override string[] Process(IGeographicPoint leftUpper, IGeographicPoint rigthLower, string dataFolder, string resultFolder)
        {
            var dataset   = new SrtmDataset(leftUpper, rigthLower, dataFolder);
            var filePaths = new List <string>();

            foreach (var processor in _processors)
            {
                filePaths.Add(processor.Process(dataset, resultFolder));
            }

            return(filePaths.ToArray());
        }
        public override string[] Process(IGeographicPoint leftUpper, IGeographicPoint rigthLower, string dataFolder, string resultFolder)
        {
            var pathToEdgedDynamic      = $@"{dataFolder}{FilenamesConstants.PathToEdgedDynamicFile}";
            var pathToAreOfDamageResult = $@"{resultFolder}{FilenamesConstants.PathToDamagedAreaResult}";

            var amountOfDynamicPoints = DrawLib.GetAmountOfDynamicPoints(pathToEdgedDynamic);

            double areaOfDamage = amountOfDynamicPoints * LandsatPixelSize;

            var resultPath = JsonHelper.Serialize(pathToAreOfDamageResult, new AreaOfDamageResult
            {
                AreaOfDamage       = areaOfDamage,
                DamagedPointsCount = amountOfDynamicPoints
            });

            return(new[] { resultPath });
        }
Beispiel #8
0
 /// <summary>
 /// Получение характеристики/условия распространения
 /// </summary>
 /// <param name="leftUpper"></param>
 /// <param name="rigthLower"></param>
 /// <param name="dataFolder"></param>
 /// <param name="resultFolder"></param>
 /// <returns></returns>
 public abstract string[] Process(IGeographicPoint leftUpper, IGeographicPoint rigthLower, string dataFolder, string resultFolder);