================================================================================
CARBONEST - FOREST CARBON STOCK & REMOVAL ESTIMATOR (QGIS PLUGIN)
================================================================================

CarbonEst (carbon_estimated_allometric) is a Python-based QGIS plugin
(QGIS 3.0+) designed to estimate tropical forest above-ground biomass, carbon
stocks, and carbon dioxide (CO2) removals using species- and genus-specific
allometric equations, complete with plot-level scaling and Inverse Distance
Weighting (IDW) spatial interpolation.

Developed for forestry, ecology, conservation, and climate change mitigation
assessments—particularly across Southeast Asian tropical ecosystems—this plugin
streamlines field inventory processing directly inside QGIS.

--------------------------------------------------------------------------------
KEY FEATURES
--------------------------------------------------------------------------------
1. Comprehensive Allometric Equation Library (Mangrove & Non-Mangrove)
   - Automatically matches sample records by Species or falls back to Genus,
     Palmae special equations, or the general tropical tree equation
     (Pohon lain: Y = 0.1728 x D^2.2234).
   - Validates diameter at breast height (DBH) bounds where applicable and
     automatically switches out-of-range measurements to the general equation.
   - Includes dedicated equations for 11 Mangrove species / 3 Mangrove genera
     and 37 Non-Mangrove species / 11 Non-Mangrove genera.

2. Automated Plot-Area Scaling & Carbon Conversion
   - Converts individual tree above-ground biomass (B, kg) into carbon stock
     (C = 0.47 x B, kg), per-hectare carbon density (Mg C/ha), and CO2
     equivalent (ton CO2/ha).
   - Automatically applies nested subplot area rules based on ecosystem type
     and DBH size class.

3. Vector, Tabular, and Spatial Raster Outputs
   - Point Vector (Titik_Cadangan_Karbon.shp): Individual tree records enriched
     with Biomass, Carbon (kg), C (Mg/ha), and CO2 (ton/ha).
   - Plot Centroids (Plot_Centroids.shp): Aggregated plot-level total carbon
     and CO2 stocks.
   - CSV Report (Tabel_Hasil_Karbon.csv): Clean tabular summary ready for
     reporting and statistical analysis.
   - IDW Interpolated Rasters (IDW_Cadangan_Karbon.tif & IDW_Serapan_CO2.tif):
     Continuous spatial distribution maps bounded by your Area of Interest
     (AOI) or plot extent.

--------------------------------------------------------------------------------
METHODOLOGY & FORMULAS
--------------------------------------------------------------------------------
1. Biomass, Carbon, and CO2 Conversion:
   - Above-Ground Biomass (B, kg/tree) : Calculated from DBH (D, cm)
   - Carbon Stock (C, kg)              : C = B x 0.47
   - Carbon per Hectare (C_ha, Mg/ha)  : C_ha = (C / 1000) x (10000 / L_plot)
   - CO2 Removal (CO2e, ton/ha)        : CO2e = C_ha x 3.67

2. Nested Plot Area Rules (L_plot):
   - Non-Mangrove:
     * DBH >= 20 cm       : 400 m2
     * 10 <= DBH < 20 cm  : 100 m2
     * 5 <= DBH < 10 cm   : 25 m2
   - Mangrove:
     * DBH > 10 cm        : 100 m2
     * 2 <= DBH <= 10 cm  : 25 m2
     * DBH < 2 cm         : 4 m2

3. Highlighted Non-Mangrove Allometric Equations (Y in kg, D in cm):
   - Pinus (Pinus merkusii)             : Y = 0.094 x D^2.432 (D: 4 - 44 cm)
   - Jati (Tectona grandis)             : Y = 0.054 x D^2.579 (D: 4.8 - 26.2 cm)
   - Mahoni daun lebar (S. mahagoni)    : Y = 0.048 x D^0.68
   - Jati putih (Gmelina arborea)       : Y = 0.128 x D^2.35
   - Akasia (Acacia mangium)            : Y = 0.1997 x D^2.2351 (D: 1.4 - 18.9 cm)
   - Nangka (Artocarpus heterophyllus)  : Y = 0.11 x 0.6 x D^2.62
   - Sengon (Falcataria moluccana)      : Y = 0.0579 x D^2.5596
   - Kayu afrika (Maesopsis eminii)     : Y = 0.2902 x D^2.312
   - Durian (Durio zibethinus)          : Y = 0.11 x 0.57 x D^2.62
   - Rambutan (Nephelium lappaceum)     : Y = 0.11 x 0.73 x D^2.62
   - Puspa (Schima wallichii)           : Y = 0.459 x D^1.366 (D: 3 - 24.6 cm)
   - Pohon lain (General Tropical Tree) : Y = 0.1728 x D^2.2234

--------------------------------------------------------------------------------
INSTALLATION
--------------------------------------------------------------------------------
Method 1: Install from ZIP in QGIS
  1. Download this repository as a .zip file (Code -> Download ZIP), ensuring
     the root folder inside the archive is named "carbon_estimated_allometric".
  2. Open QGIS (version 3.0 or higher) and go to Plugins -> Manage and Install
     Plugins... -> Install from ZIP.
  3. Browse to the downloaded .zip file and click Install Plugin.

Method 2: Manual Installation
  1. Copy the "carbon_estimated_allometric" folder into your active QGIS user
     profile plugins directory:
     - Windows : C:\Users\<Username>\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\
     - Linux   : ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/
     - macOS   : ~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/
  2. Restart QGIS and enable "CarbonEst" under Installed plugins.

--------------------------------------------------------------------------------
USAGE
--------------------------------------------------------------------------------
1. Prepare Sample Point Layer:
   Ensure your input vector point layer uses a Projected Coordinate System
   (e.g., UTM in meters) and contains attributes for Plot ID, Species, Genus,
   and DBH (cm).

2. Open CarbonEst:
   Click the "CarbonEst" icon on the toolbar or navigate to Plugins -> CarbonEst.

3. Configure Parameters:
   - Select the input sample point layer and map the Plot ID, Species, Genus,
     and DBH fields.
   - Choose the ecosystem type (Mangrove or Non-Mangrove).
   - Optionally select an AOI Boundary layer, define the raster Pixel Size (m),
     and choose an Output Directory.

4. Run Estimation:
   Click OK / Process. The shapefiles, CSV summary, and IDW rasters will be
   saved to your output directory and automatically loaded into QGIS.

--------------------------------------------------------------------------------
CHANGELOG
--------------------------------------------------------------------------------
Version 1.0.4
- Added 7 non-mangrove allometric equations: Swietenia mahagoni (Lokbere et al.,
  2017), Gmelina arborea (Rifai, 2024), Artocarpus heterophyllus (Ketterings et
  al., 2001), Falcataria moluccana (Rusolono, 2006), Maesopsis eminii (Samalca,
  2007), Durio zibethinus (Ketterings et al., 2001), and Nephelium lappaceum
  (Ketterings et al., 2001).

Version 1.0.3
- Initial release with Mangrove and Non-Mangrove species/genus allometric
  lookup, nested subplot scaling, CSV/Shapefile export, and IDW spatial
  interpolation.

--------------------------------------------------------------------------------
AUTHORS & SUPPORT
--------------------------------------------------------------------------------
Authors       : Muhammad Parif & Devi Wulandari (IPB University)
Email         : payip28muhammad@apps.ipb.ac.id
Repository    : https://github.com/muhammad-parif/carbon_estimated_allometric
Issue Tracker : https://github.com/muhammad-parif/carbon_estimated_allometric/issues
================================================================================