Esempio n. 1
0
        private void cMeanPatchSize(string filename, string epsg, int fieldIndex)
        {
            try
            {
                C_Area_V cArea = new C_Area_V(filename, epsg, fieldIndex);
                _categoryNames         = cArea.CategoryNames;
                _totalAreasPerCategory = cArea.TotalAreas;

                C_NumPatches_V cNumPatches = new C_NumPatches_V(filename, epsg, fieldIndex);
                _numPatchesPerCategory = cNumPatches.NumPatches;


                for (int i = 0; i < _totalAreasPerCategory.Count; i++)
                {
                    _meanPatchSizePerCategory.Add(((double)_totalAreasPerCategory[i] / (int)_numPatchesPerCategory[i]) / 10000);
                }



                _cMeanPatchSize_V.Columns.Add("CategoryName", typeof(string));
                _cMeanPatchSize_V.Columns.Add("CategoryMeanPatchSize", typeof(double));

                for (int i = 0; i < _categoryNames.Count; i++)
                {
                    _cMeanPatchSize_V.Rows.Add(_categoryNames[i], _meanPatchSizePerCategory[i]);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        private void cCoreAreaPercentOfLandscape(string filename, string epsg, int fieldIndex, double depthOfEdge)
        {
            try
            {
                C_Area_V areas = new C_Area_V(filename, epsg, fieldIndex);
                _categoryNames = areas.CategoryNames;


                for (int i = 0; i < areas.TotalAreas.Count; i++)
                {
                    totalArea += (double)areas.TotalAreas[i];
                }


                C_CoreArea_V coreAreas = new C_CoreArea_V(filename, epsg, fieldIndex, depthOfEdge);
                _coreAreaPerCategory = coreAreas.TotalCoreArea;



                for (int i = 0; i < _coreAreaPerCategory.Count; i++)
                {
                    _coreAreaPercentOfLandscape.Add(((double)_coreAreaPerCategory[i] / totalArea) * 100);
                }


                _cCoreAreaPercentOfLandscape_V.Columns.Add("CategoryName", typeof(string));
                _cCoreAreaPercentOfLandscape_V.Columns.Add("CategoryCoreAreaPercentOfLandscape", typeof(double));

                for (int i = 0; i < _categoryNames.Count; i++)
                {
                    _cCoreAreaPercentOfLandscape_V.Rows.Add(_categoryNames[i], _coreAreaPercentOfLandscape[i]);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void cLargestPatchIndex(string filename, string epsg, int fieldIndex)
        {
            try
            {
                C_Area_V cAreas = new C_Area_V(filename, epsg, fieldIndex);


                for (int i = 0; i < cAreas.TotalAreas.Count; i++)
                {
                    totalArea += (double)cAreas.TotalAreas[i];
                }


                C_LargestPatchSize_V LPS = new C_LargestPatchSize_V(filename, epsg, fieldIndex);
                _categoryNames = LPS.CategoryNames;



                for (int i = 0; i < _categoryNames.Count; i++)
                {
                    _largestPatchIndexPerCategory.Add(((double)LPS.LargestPatchSize[i] / totalArea) * 100);
                }


                _cLargestPatchIndex_V.Columns.Add("CategoryName", typeof(string));
                _cLargestPatchIndex_V.Columns.Add("LargestPatchIndex", typeof(double));

                for (int i = 0; i < _categoryNames.Count; i++)
                {
                    _cLargestPatchIndex_V.Rows.Add(_categoryNames[i], _largestPatchIndexPerCategory[i]);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }