Download DEM¶
In [ ]:
Copied!
%load_ext autoreload
%autoreload 2
import geopandas as gpd
from eo_tools.dem import retrieve_dem
import logging
import rioxarray as riox
logging.basicConfig(level=logging.INFO)
%load_ext autoreload
%autoreload 2
import geopandas as gpd
from eo_tools.dem import retrieve_dem
import logging
import rioxarray as riox
logging.basicConfig(level=logging.INFO)
Download¶
In [2]:
Copied!
# load a geometry
aoi_name = "Morocco_AOI"
aoi_file = f"../data/{aoi_name}.geojson"
shp = gpd.read_file(aoi_file).geometry[0]
# change to your custom location
dem_file = f"/data/res/cop-dem-glo-30_{aoi_name}.tif"
retrieve_dem(shp, dem_file)
# load a geometry
aoi_name = "Morocco_AOI"
aoi_file = f"../data/{aoi_name}.geojson"
shp = gpd.read_file(aoi_file).geometry[0]
# change to your custom location
dem_file = f"/data/res/cop-dem-glo-30_{aoi_name}.tif"
retrieve_dem(shp, dem_file)
Visualize¶
In [3]:
Copied!
pth_arr = dem_file
arr = riox.open_rasterio(pth_arr)
arr[0].plot.imshow(cmap="gray")
pth_arr = dem_file
arr = riox.open_rasterio(pth_arr)
arr[0].plot.imshow(cmap="gray")
Out[3]:
<matplotlib.image.AxesImage at 0x7f4aa4ab4c80>