Land Cover Maps#

Land cover maps use integer classification IDs that reference a windkit.LandCoverTable for surface properties (roughness and displacement height). This allows additional data beyond roughness to be used in flow calculations.

Data Structure#

Vector Format - Lines (geopandas.GeoDataFrame)

Columns:
    id_left   - land cover ID on left side of line
    id_right  - land cover ID on right side of line
    geometry  - LINESTRING (land cover change boundaries)

Vector Format - Polygons (geopandas.GeoDataFrame)

Columns:
    id        - land cover ID
    geometry  - POLYGON (land cover areas)

Raster Format (xarray.DataArray)

DataArray:
    name: landcover
    dims: (south_north, west_east)
    dtype: integer (land cover class ID)

Land Cover Table#

The windkit.LandCoverTable maps IDs to surface properties:

LandCoverTable:
    id            - land cover class ID (integer)
    description   - class description (e.g., "Forest", "Urban")
    z0            - surface roughness length (meters)
    displacement  - displacement height (meters)

Example table:

ID

Description

z0 (m)

Displacement (m)

1

Water

0.0

0.0

2

Grass

0.03

0.0

3

Agricultural

0.1

0.0

4

Forest

0.8

10.0

5

Urban

1.2

5.0

I/O#

Reading:

windkit.read_landcover_map() reads land cover classification data:

lc_map = wk.read_landcover_map("landcover.gml", crs="EPSG:32629")

Writing:

windkit.landcover_map_to_file() writes land cover maps:

wk.landcover_map_to_file(lc_map, "output.gml", lc_tbl)

Converting Between Formats#

Roughness to Land Cover:

windkit.roughness_to_landcover() converts roughness maps to land cover format. This is useful when you have a roughness map with z0_left/z0_right columns (change lines):

# Read roughness map (lines with z0_left/z0_right)
roughness_map = wk.read_roughness_map("roughness.map", crs="EPSG:32629")

# Convert to land cover format
lc_map, lc_tbl = wk.roughness_to_landcover(roughness_map)

Land Cover to Roughness:

windkit.landcover_to_roughness() converts back to roughness values:

roughness_back = wk.landcover_to_roughness(lc_map, lc_tbl)

Usage in PyWAsP#

Land cover maps are used with pywasp.wasp.TopographyMap:

import pywasp as pw
import windkit as wk

elev_map = wk.read_elevation_map("terrain.map", crs="EPSG:32629")
lc_map, lc_tbl = wk.read_roughness_map(
    "terrain.map",
    crs="EPSG:32629",
    convert_to_landcover=True,
)

topo_map = pw.wasp.TopographyMap(elev_map, lc_map, lc_tbl)