added vegetation
This commit is contained in:
@@ -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)),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user