Elevation Maps#
Elevation maps describe the height of the Earth’s surface above sea level. They can be stored as vector data (contour lines) or raster data (height grids).
Data Structure#
Vector Format (geopandas.GeoDataFrame)
Columns:
elev - elevation value (meters above sea level)
geometry - LINESTRING (contour lines) or POLYGON
Raster Format (xarray.DataArray)
DataArray:
name: elevation
dims: (south_north, west_east)
dtype: float (meters above sea level)
I/O#
Reading:
windkit.read_elevation_map() reads elevation from raster or vector files:
elev_vector = wk.read_elevation_map("elev.map")
Writing:
windkit.elevation_map_to_file() writes elevation maps:
wk.elevation_map_to_file(elev_raster, "output.tif")
Working with Raster Elevation#
Raster data can be reprojected using windkit.spatial.warp():
warped = wk.spatial.warp(raster_in_latlon, to_crs="EPSG:32632")
Clip raster to smaller area using windkit.spatial.clip()
# Clip raster to a smaller area
bbox = wk.spatial.BBox.from_cornerpts(
minx=502000, miny=4602000,
maxx=508000, maxy=4608000,
crs="EPSG:32629"
)
clipped = wk.spatial.clip(raster, bbox)