public override IExtractResult Make(Action <int, string> progressTracker)
        {
            if (_argumentProvider == null)
            {
                return(null);
            }
            List <string> covertDegreeRegions = _argumentProvider.GetArg("CovertDegreeRegion") as List <string>;

            if (_argumentProvider.GetArg("AlgorithmName") == null || covertDegreeRegions == null || covertDegreeRegions.Count == 0)
            {
                return(null);
            }
            if (_argumentProvider.GetArg("AlgorithmName").ToString() == "BCDF")
            {
                int count = covertDegreeRegions.Count;
                ExtractResultArray results = new ExtractResultArray("BAG_BCDF");
                for (int i = 0; i < count; i++)
                {
                    float[]           minmax = BAGStatisticHelper.GetCovertDegreeValue(covertDegreeRegions[i]);
                    FileExtractResult result = FREQAlgorithm(minmax[0], minmax[1]) as FileExtractResult;
                    results.Add(result);
                }
                return(results);
            }
            return(null);
        }
Ejemplo n.º 2
0
        private List <string[]> StaticAreaByRegions(List <string> covertDegreeRegions, IRasterDataProvider cloudProvider, IRasterDataProvider coverDegreeProvider, int[] aoi, string regionName)
        {
            if (covertDegreeRegions == null || covertDegreeRegions.Count == 0)
            {
                return(null);
            }
            List <string[]> resultList  = new List <string[]>();
            double          cloudArea   = StatCloudConvertArea(cloudProvider, aoi);
            double          totalAreas  = 0;
            double          actualAreas = 0;

            for (int i = 0; i < covertDegreeRegions.Count; i++)
            {
                List <string> statresult = new List <string>();
                float[]       minmax     = BAGStatisticHelper.GetCovertDegreeValue(covertDegreeRegions[i]);
                //累计指定等级的总覆盖面积
                double totalArea = StatAccumulativeTotalArea(coverDegreeProvider, aoi, minmax[0], minmax[1]);
                //累计计算指定等级的实际覆盖面积
                double actualArea = StatAccumulativeActualArea(coverDegreeProvider, aoi, minmax[0], minmax[1]);
                totalAreas  += totalArea;
                actualAreas += actualArea;
                if (i == 0)
                {
                    statresult.Add(regionName);
                }
                else
                {
                    statresult.Add("");
                }
                statresult.Add(covertDegreeRegions[i]);
                statresult.Add(Math.Round(totalArea, 2).ToString());
                statresult.Add(Math.Round(actualArea, 2).ToString());
                statresult.Add(Math.Round(cloudArea, 2).ToString());
                resultList.Add(statresult.ToArray());
            }
            resultList.Add(new string[] { "", "合计", totalAreas.ToString(), actualAreas.ToString(), cloudArea.ToString() });
            return(resultList);
        }