private void patchMetrics(string filename, string epsg, int fieldIndex, double depthOfEdge) { try { SchemaDB_Reader namesCollection = new SchemaDB_Reader(filename, fieldIndex); _patchNames = namesCollection.FieldValues; GeometryCoreReader g = new GeometryCoreReader(filename, epsg, depthOfEdge); //obtenemos las coreAreas divididas por 10.000 (en ha.) for (int i = 0; i < g.Areas.Count; i++) { _coreAreas.Add((double)g.CoreAreas[i]); // 10000); } _pCoreArea_V.Columns.Add("PatchName", typeof(string)); _pCoreArea_V.Columns.Add("PatchCoreArea", typeof(double)); for (int i = 0; i < _patchNames.Count; i++) { _pCoreArea_V.Rows.Add(_patchNames[i], _coreAreas[i]); } } catch (Exception ex) { throw ex; } }
private void landscapeMetrics(string filename, string epsg, double depthOfEdge) { try { L_Area_V totalArea = new L_Area_V(filename, epsg); GeometryCoreReader metrics = new GeometryCoreReader(filename, epsg, depthOfEdge); for (int i = 0; i < metrics.CoreAreas.Count; i++) { totalCoreArea += (double)metrics.CoreAreas[i]; numberOfDisjunctCoreAreas += (int)metrics.NumCoreAreas[i]; } //total core area to hectares totalCoreArea = totalCoreArea / 10000; //total landscape area is already in hectares disjunctCoreAreaDensity = ((numberOfDisjunctCoreAreas / (double)totalArea.LandscapeArea)) * 100; } catch (Exception ex) { throw ex; } }
private void pNumCoreAreas(string filename, string epsg, int fieldIndex, double depthOfEdge) { try { SchemaDB_Reader namesCollection = new SchemaDB_Reader(filename, fieldIndex); _patchNames = namesCollection.FieldValues; GeometryCoreReader g = new GeometryCoreReader(filename, epsg, depthOfEdge); //el num de core areas no cambia _numCoreAreas = g.NumCoreAreas; _pNumCoreAreas_V.Columns.Add("PatchName", typeof(string)); _pNumCoreAreas_V.Columns.Add("PatchNumCoreAreas", typeof(int)); for (int i = 0; i < _patchNames.Count; i++) { _pNumCoreAreas_V.Rows.Add(_patchNames[i], _numCoreAreas[i]); } } catch (Exception ex) { throw ex; } }
private void pCoreAreaIndex(string filename, string epsg, int fieldIndex, double depthOfEdge) { try { SchemaDB_Reader namesCollection = new SchemaDB_Reader(filename, fieldIndex); _patchNames = namesCollection.FieldValues; GeometryCoreReader g = new GeometryCoreReader(filename, epsg, depthOfEdge); //el siguiente indice se calcula en porcentajes, por lo que las unidades deben //ser las mismas. for (int i = 0; i < g.Areas.Count; i++) { _coreAreaIndex.Add(((double)g.CoreAreas[i] / (double)g.Areas[i]) * 100); } _pCoreAreaIndex_V.Columns.Add("PatchName", typeof(string)); _pCoreAreaIndex_V.Columns.Add("PatchCoreAreaIndex", typeof(double)); for (int i = 0; i < _patchNames.Count; i++) { _pCoreAreaIndex_V.Rows.Add(_patchNames[i], _coreAreaIndex[i]); } } catch (Exception ex) { throw ex; } }
private void patchMetrics(string filename, string epsg, int fieldIndex, double depthOfEdge) { try { SchemaDB_Reader namesCollection = new SchemaDB_Reader(filename, fieldIndex); _patchNames = namesCollection.FieldValues; GeometryCoreReader g = new GeometryCoreReader(filename, epsg, depthOfEdge); //obtenemos las coreAreas divididas por 10.000 (en ha.) for (int i = 0; i < g.Areas.Count; i++) { _coreAreas.Add((double)g.CoreAreas[i]); // 10000); } //el num de core areas no cambia _numCoreAreas = g.NumCoreAreas; //el siguiente indice se calcula en porcentajes, por lo que las unidades deben //ser las mismas. for (int i = 0; i < g.Areas.Count; i++) { _coreAreaIndex.Add(((double)g.CoreAreas[i] / (double)g.Areas[i]) * 100); } } catch (Exception ex) { throw ex; } }
private void lNumberOfDisjunctCoreAreas(string filename, string epsg, double depthOfEdge) { try { GeometryCoreReader metrics = new GeometryCoreReader(filename, epsg, depthOfEdge); for (int i = 0; i < metrics.CoreAreas.Count; i++) { numberOfDisjunctCoreAreas += (int)metrics.NumCoreAreas[i]; } } catch (Exception ex) { throw ex; } }
private void lTotalCoreArea(string filename, string epsg, double depthOfEdge) { try { GeometryCoreReader metrics = new GeometryCoreReader(filename, epsg, depthOfEdge); for (int i = 0; i < metrics.CoreAreas.Count; i++) { totalCoreArea += (double)metrics.CoreAreas[i]; } //total core area to hectares totalCoreArea = totalCoreArea / 10000; } catch (Exception ex) { throw ex; } }