voxcity.geoprocessor.raster.canopyยถ
Functionsยถ
Create a vegetation height grid from a GeoDataFrame of vegetation polygons/objects. |
|
|
Create a height grid from a terrain GeoDataFrame using nearest-neighbor sampling. |
|
Create canopy top and bottom height grids from a tree GeoDataFrame. |
Module Contentsยถ
- voxcity.geoprocessor.raster.canopy.create_vegetation_height_grid_from_gdf_polygon(veg_gdf, mesh_size, polygon)[source]ยถ
Create a vegetation height grid from a GeoDataFrame of vegetation polygons/objects. Cells with vegetation take the max height of intersecting features. Returns uv_m/SOUTH_UP grid (axis 0 = u/north, row 0 = southern origin edge).
Uses
compute_cell_center_coords()so rotated rectangles are handled correctly.
- voxcity.geoprocessor.raster.canopy.create_dem_grid_from_gdf_polygon(terrain_gdf, mesh_size, polygon)[source]ยถ
Create a height grid from a terrain GeoDataFrame using nearest-neighbor sampling. Returns uv_m/SOUTH_UP grid (axis 0 = u/north, row 0 = southern origin edge).
Uses
compute_cell_center_coords()so rotated rectangles are handled correctly.
- voxcity.geoprocessor.raster.canopy.create_canopy_grids_from_tree_gdf(tree_gdf, meshsize, rectangle_vertices)[source]ยถ
Create canopy top and bottom height grids from a tree GeoDataFrame.
Supports both Point geometries (individual trees with ellipsoid crowns) and Polygon geometries (forest/wood areas with flat canopy).
- Parameters:
tree_gdf โ GeoDataFrame with columns: - geometry: Point or Polygon/MultiPolygon - top_height: Height to canopy top (meters) - bottom_height: Height to canopy bottom (meters) - crown_diameter: Crown diameter (meters, used for Point geometries) - geometry_type (optional): โpointโ or โpolygonโ to distinguish geometry types
meshsize โ Grid cell size in meters
rectangle_vertices โ List of (lon, lat) tuples defining the area
- Returns:
(canopy_height_grid, canopy_bottom_height_grid)
- Return type:
tuple