Area Estimation¶
Estimate forest area by land type and various categories.
Overview¶
The area() function calculates forest area estimates with proper variance estimation.
import pyfia
db = pyfia.FIA("georgia.duckdb")
db.clip_by_state("GA")
# Total forest area
total = pyfia.area(db, land_type="forest")
# Area by forest type
by_type = pyfia.area(db, land_type="forest", grp_by="FORTYPGRPCD")
Function Reference¶
area
¶
area(db: Union[str, FIA], grp_by: Optional[Union[str, List[str]]] = None, land_type: str = 'forest', area_domain: Optional[str] = None, plot_domain: Optional[str] = None, most_recent: bool = False, eval_type: Optional[str] = None, variance: bool = False, totals: bool = True) -> DataFrame
Estimate forest area from FIA data.
Calculates area estimates using FIA's design-based estimation methods with proper expansion factors and stratification. Automatically handles EVALID selection to prevent overcounting from multiple evaluations.
| PARAMETER | DESCRIPTION |
|---|---|
db
|
Database connection or path to FIA database. Can be either a path string to a DuckDB/SQLite file or an existing FIA connection object.
TYPE:
|
grp_by
|
Column name(s) to group results by. Can be any column from the PLOT and COND tables. Common grouping columns include: Ownership and Management: - 'OWNGRPCD': Ownership group (10=National Forest, 20=Other Federal, 30=State/Local, 40=Private) - 'OWNCD': Detailed ownership code (see REF_RESEARCH_STATION) - 'ADFORCD': Administrative forest code - 'RESERVCD': Reserved status (0=Not reserved, 1=Reserved) Forest Characteristics: - 'FORTYPCD': Forest type code (see REF_FOREST_TYPE) - 'STDSZCD': Stand size class (1=Large diameter, 2=Medium diameter, 3=Small diameter, 4=Seedling/sapling, 5=Nonstocked) - 'STDORGCD': Stand origin (0=Natural, 1=Planted) - 'STDAGE': Stand age in years Site Characteristics: - 'SITECLCD': Site productivity class (1=225+ cu ft/ac/yr, 2=165-224, 3=120-164, 4=85-119, 5=50-84, 6=20-49, 7=0-19) - 'PHYSCLCD': Physiographic class code Location: - 'STATECD': State FIPS code - 'UNITCD': FIA survey unit code - 'COUNTYCD': County code - 'INVYR': Inventory year Disturbance and Treatment: - 'DSTRBCD1', 'DSTRBCD2', 'DSTRBCD3': Disturbance codes - 'TRTCD1', 'TRTCD2', 'TRTCD3': Treatment codes For complete column descriptions, see USDA FIA Database User Guide.
TYPE:
|
land_type
|
Land type to include in estimation:
TYPE:
|
area_domain
|
SQL-like filter expression for COND-level attributes. Examples:
TYPE:
|
plot_domain
|
SQL-like filter expression for PLOT-level attributes. This parameter enables filtering by plot location and attributes that are not available in the COND table. Examples: Location filtering: - "COUNTYCD == 183": Wake County, NC (single county) - "COUNTYCD IN (183, 185, 187)": Multiple counties - "UNITCD == 1": Survey unit 1 Geographic filtering: - "LAT >= 35.0 AND LAT <= 36.0": Latitude range - "LON >= -80.0 AND LON <= -79.0": Longitude range - "ELEV > 2000": Elevation above 2000 feet Temporal filtering: - "INVYR == 2019": Inventory year - "MEASYEAR >= 2015": Measured since 2015 Note: plot_domain filters apply to PLOT table columns only. For condition-level attributes (ownership, forest type, etc.), use area_domain instead.
TYPE:
|
most_recent
|
If True, automatically select the most recent evaluation for each state/region. Equivalent to calling db.clip_most_recent() first.
TYPE:
|
eval_type
|
Evaluation type to select if most_recent=True. Options: 'ALL', 'VOL', 'GROW', 'MORT', 'REMV', 'CHANGE', 'DWM', 'INV'. Default is 'ALL' for area estimation.
TYPE:
|
variance
|
If True, return variance instead of standard error.
TYPE:
|
totals
|
If True, include total area estimates expanded to population level. If False, only return per-acre values.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DataFrame
|
Area estimates with the following columns:
|
See Also
pyfia.volume : Estimate tree volume pyfia.biomass : Estimate tree biomass pyfia.tpa : Estimate trees per acre pyfia.constants.ForestTypes : Forest type code definitions pyfia.constants.StateCodes : State FIPS code definitions
Notes
The area estimation follows USDA FIA's design-based estimation procedures as described in Bechtold & Patterson (2005). The basic formula is:
Area = Σ(CONDPROP_UNADJ × ADJ_FACTOR × EXPNS)
Where: - CONDPROP_UNADJ: Proportion of plot in the condition - ADJ_FACTOR: Adjustment factor based on PROP_BASIS - EXPNS: Expansion factor from stratification
EVALID Handling: If no EVALID is specified, the function automatically selects the most recent EXPALL evaluation to prevent overcounting from multiple evaluations. For explicit control, use db.clip_by_evalid() before calling area().
Valid Grouping Columns: The function loads comprehensive sets of columns from COND and PLOT tables. Not all columns are suitable for grouping - continuous variables like LAT, LON, ELEV should not be used. The function will error if a requested grouping column is not available in the loaded data.
NULL Value Handling: Some grouping columns may contain NULL values (e.g., PHYSCLCD ~18% NULL, DSTRBCD1 ~22% NULL). NULL values are handled safely by Polars and will appear as a separate group in results if present.
Examples:
Basic forest area estimation:
>>> from pyfia import FIA, area
>>> with FIA("path/to/fia.duckdb") as db:
... db.clip_by_state(37) # North Carolina
... results = area(db, land_type="forest")
Area by ownership group:
Timber area by forest type for stands over 50 years:
>>> results = area(
... db,
... grp_by="FORTYPCD",
... land_type="timber",
... area_domain="STDAGE > 50"
... )
Multiple grouping variables:
>>> results = area(
... db,
... grp_by=["STATECD", "OWNGRPCD", "STDSZCD"],
... land_type="forest"
... )
Area by disturbance type:
>>> results = area(
... db,
... grp_by="DSTRBCD1",
... area_domain="DSTRBCD1 > 0" # Only disturbed areas
... )
Filter by county using plot_domain:
>>> results = area(
... db,
... plot_domain="COUNTYCD == 183", # Wake County, NC
... land_type="forest"
... )
Combine plot and area domain filters:
>>> results = area(
... db,
... plot_domain="COUNTYCD IN (183, 185, 187)", # Multiple counties
... area_domain="OWNGRPCD == 40", # Private land only
... grp_by="FORTYPCD"
... )
Geographic filtering with plot_domain:
>>> results = area(
... db,
... plot_domain="LAT >= 35.0 AND LAT <= 36.0 AND ELEV > 1000",
... land_type="forest"
... )
Source code in src/pyfia/estimation/estimators/area.py
522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 | |
Examples¶
Total Forest Area¶
result = pyfia.area(db, land_type="forest")
print(f"Forest Area: {result['estimate'][0]:,.0f} acres")
print(f"SE: {result['se'][0]:,.0f} acres")
Timberland Area¶
result = pyfia.area(db, land_type="timber")
print(f"Timberland: {result['estimate'][0]:,.0f} acres")