I/O#

WindKit supports reading and writing topographic maps in both vector and raster formats. The same file formats can be used for all topographic data types (elevation, roughness, and land cover).

Supported Formats#

The following vector and raster topography map formats are supported:

Format

Type

Read

Write

Description

.map

Vector

yes

yes

WAsP MAP format

.gpkg

Vector

yes

yes

GeoPackage

.gml

Vector

yes

yes

Geography Markup Language

.tif

Raster

yes

yes

GeoTIFF

.grd

Raster

yes

yes

Golden Software ASCII Grid

.vrt

Raster

yes

no

GDAL Virtual Format

.nc

Raster

yes

yes

NetCDF

See the individual map type pages for more details:

Reading from Zip Archives#

A map inside a zip archive can be read without extracting it: pass the open archive member to windkit.read_elevation_map(), windkit.read_roughness_map() or windkit.read_landcover_map(). The format is taken from the member’s name, as for a file on disk:

import zipfile

with zipfile.ZipFile("site_data.zip") as archive:
    with archive.open("maps/terrain.map") as member:
        elev_map = wk.read_elevation_map(member, crs="EPSG:32629")

Only the member itself is read. Files that belong with it elsewhere in the archive, such as the .aux.xml of a .grd or the sources of a .vrt, are not.