Advanced#
Map Conversion from Lines to Polygons#
Convert between polygon and line map formats:
windkit.lines_to_polygons()- Convert line maps to polygon mapswindkit.polygons_to_lines()- Convert polygon maps to line maps
Downloading Data#
windkit.get_raster_map() and windkit.get_vector_map() download
topographic data for a bounding box. The source argument selects where from:
"planetary_computer"- Microsoft Planetary Computer (default for raster maps)"earth_engine"- Google Earth Engine"dtu"- DTU’s Global Wind Atlas map service (the only source forget_vector_map())
bbox = wk.spatial.BBox.from_cornerpts(
minx=-8.2, miny=41.7, maxx=-8.0, maxy=41.8, crs="EPSG:4326"
)
elevation = wk.get_raster_map(bbox, dataset="NASADEM")
The API documentation of each function lists the available datasets.
Note
The Planetary Computer and Earth Engine sources need the data_apis
optional dependencies (pip install "windkit[data_apis]").
Google Earth Engine also needs an authenticated account. WindKit connects to
it the first time an Earth Engine dataset is requested, not on import, and
raises a RuntimeError if that fails; run earthengine authenticate on
the command line and try again.
Please read the terms of service of these platforms before downloading and using their data.