Skip to content

Commit

Permalink
Add lidar_buffer to instruction set
Browse files Browse the repository at this point in the history
  • Loading branch information
rosepearson committed Aug 4, 2023
1 parent 4037cf9 commit 74ee375
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/geofabrics/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def get_instruction_general(self, key: str):
"elevation_range": None,
"lidar_interpolation_method": "idw",
"download_limit_gbytes": 100,
"lidar_buffer": 0,
}

assert key in defaults or key in self.instructions["general"], (
Expand Down Expand Up @@ -855,7 +856,7 @@ def run(self):
self.raw_dem.dem.to_netcdf(
self.get_instruction_path("raw_dem"), format="NETCDF4", engine="netcdf4"
)

# Add a coarse DEM if significant area without LiDAR and a coarse DEM
if self.check_vector_or_raster(key="coarse_dems", api_type="raster"):
coarse_dem_paths = self.get_vector_or_raster_paths(
Expand All @@ -865,7 +866,7 @@ def run(self):
# Add coarse DEMs if there are any and if area
if self.raw_dem.add_coarse_dems(coarse_dem_paths=coarse_dem_paths,
area_threshold=area_threshold,
buffer_cells=5):
buffer_cells=self.get_instruction_general("lidar_buffer")):

# TODO setup internals to chunked adding of coarse DEM values
logging.info("In processor.DemGenerator - yet to setup lazy "
Expand Down
3 changes: 2 additions & 1 deletion tests/test_dem_generation_local_1/instruction.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"general": {
"drop_offshore_lidar": true,
"lidar_classifications_to_keep": [2],
"interpolation_method": "linear"
"interpolation_method": "linear",
"lidar_buffer": 5
}
}

0 comments on commit 74ee375

Please sign in to comment.