added vegetation

This commit is contained in:
2026-06-23 13:57:33 +03:00
parent 0c9fc22d22
commit c7435955c3
32 changed files with 336 additions and 15 deletions
+8 -2
View File
@@ -1,6 +1,8 @@
from app.config import get_settings
from app.core.geo import GeoPoint, sample_path
from app.core.landcover import LandcoverNotConfiguredError, landcover_path
from app.core.raster_sampling import raster_files
from app.models.common import DataSources
from app.models.landcover import LandcoverPathRequest, LandcoverPathResponse, LandcoverSegment
@@ -17,8 +19,8 @@ def path_landcover(request: LandcoverPathRequest) -> LandcoverPathResponse:
landcover_path_dir=settings.landcover_path,
canopy_path_dir=settings.canopy_path,
)
except LandcoverNotConfiguredError as exc:
raise NotImplementedError(str(exc)) from exc
except LandcoverNotConfiguredError:
raise
return LandcoverPathResponse(
segments=[
@@ -32,4 +34,8 @@ def path_landcover(request: LandcoverPathRequest) -> LandcoverPathResponse:
for segment in result.segments
],
vegetation_depth_m=result.vegetation_depth_m,
data_sources=DataSources(
landcover=True,
canopy=bool(raster_files(settings.canopy_path)),
),
)