Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions fastfuels_sdk/convenience.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ def _deep_merge(base: Dict[str, Any], override: Dict[str, Any]) -> None:
"featureGridAttributes": ["road", "water"],
}

DEFAULT_TREE_INVENTORY_CONFIG = {"featureMasks": ["road", "water"]}
DEFAULT_TREE_INVENTORY_CONFIG = {
"featureMasks": ["road", "water"],
"canopyHeightMapSource": "Meta2024",
}


def _configure_topography_builder(domain_id: str, config: Dict[str, Any]):
Expand Down Expand Up @@ -497,7 +500,10 @@ def export_roi(
tree_inventory = Inventories.from_domain_id(
domain.id
).create_tree_inventory_from_treemap(
feature_masks=["road", "water"], canopy_height_map_source="Meta2024"
feature_masks=merged_tree_inventory_config.get("featureMasks", []),
canopy_height_map_source=merged_tree_inventory_config.get(
"canopyHeightMapSource"
),
)

# Create surface grid using configuration
Expand Down
3 changes: 2 additions & 1 deletion tests/test_convenience_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def test_current_hardcoded_topography_config(

# Verify tree inventory was created with current masks
mock_inventories_instance.create_tree_inventory_from_treemap.assert_called_once_with(
feature_masks=["road", "water"]
feature_masks=["road", "water"], canopy_height_map_source="Meta2024"
)

def test_default_configuration_constants(self):
Expand Down Expand Up @@ -181,6 +181,7 @@ def test_default_configuration_constants(self):

# Test tree inventory config
assert DEFAULT_TREE_INVENTORY_CONFIG["featureMasks"] == ["road", "water"]
assert DEFAULT_TREE_INVENTORY_CONFIG["canopyHeightMapSource"] == "Meta2024"


class TestConfigurationMerger:
Expand Down
Loading