{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Get Copernicus DEM using EODAG\n", "\n", "This tutorial will help you to search and download Copernicus DEM using EODAG" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import os\n", "from eodag import EODataAccessGateway" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create a workspace directory `eodag_workspace_copdem` where all our files will live:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "workspace = 'eodag_workspace_copdem'\n", "if not os.path.isdir(workspace):\n", " os.mkdir(workspace)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Search products" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Init EODAG and get available product types from Copernicus DEM" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['COP_DEM_GLO30_DGED',\n", " 'COP_DEM_GLO30_DTED',\n", " 'COP_DEM_GLO90_DGED',\n", " 'COP_DEM_GLO90_DTED']" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dag = EODataAccessGateway()\n", "\n", "dag.guess_product_type(keywords=\"DEM\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Check which providers support `COP_DEM_GLO30_DGED`" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['creodias', 'wekeo']" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "product_type = \"COP_DEM_GLO30_DGED\"\n", "dag.available_providers(product_type)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Product type 'COP_DEM_GLO30_DGED' is not available with provider 'peps'. Searching it on provider 'creodias' instead.\n" ] }, { "data": { "text/plain": [ "SearchResult([EOProduct(id=DEM1_SAR_DGE_30_20110216T174143_20140906T174215_ADS_000000_jSLP, provider=creodias),\n", " EOProduct(id=DEM1_SAR_DGE_30_20110417T175032_20140906T174215_ADS_000000_PIJx, provider=creodias),\n", " EOProduct(id=DEM1_SAR_DGE_30_20110428T174952_20140831T175054_ADS_000000_Q3FX, provider=creodias)])" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "search_geom = [0.25, 43.2, 2.8, 43.9]\n", "search_result, count = dag.search(productType=product_type, geom=search_geom)\n", "search_result" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Draw results geometries on a map:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "