These scripts are for creating a global (or regional) water mask dataset based off of OpenStreetMaps, and optionally augmented by ESA WorldCover.
For the OSM water mask dataset, follow these steps to replicate our dataset:
- Install osmium-tool from conda-forge or "https://osmcode.org/osmium-tool/".
- Download the "Latest Weekly Planet PBF File" file from here: "https://planet.openstreetmap.org/".
- Download the WGS84 water polygons shapefile from: "https://osmdata.openstreetmap.de/data/water-polygons.html".
- The files should be unzipped and you should have something like
planet.osm.pbf
orplanet.pbf
andwater_polygons.shp
(and the support files forwater_polygons.shp
). - Run
generate_osm_dataset --planet-file-path [path-to-planet.pbf] --ocean-polygons-path [path-to-water-polygons.shp] --lat-begin -85 --lat-end 85 --lon-begin -180 --lon-end 180 --tile-width 5 --tile-height 5
- Run
fill_missing_tiles --fill-value 0 --lat-begin -90 --lat-end -85 --lon-begin -180 --lon-end 180 --tile-width 5 --tile-height 5
- Run
fill_missing_tiles --fill-value 1 --lat-begin 85 --lat-end 90 --lon-begin -180 --lon-end 180 --tile-width 5 --tile-height 5
For the WorldCover water mask dataset, follow these steps:
- Download the portions of the dataset for the areas you would like to cover from here: "https://worldcover2020.esa.int/downloader"
- Extract the contents into a folder. Note, if you download multiple portions of the dataset, extract them all into the same folder.
- Run
generate_worldcover_dataset --worldcover-tiles-dir [path-to-worldcover-data] --lat-begin 55 --lat-end 80 --lon-begin -180 --lon-end 180 --tile-width 5 --tile-height 5
Note that we only use WorldCover data over Alaska, Canada, and Russia for our dataset.