|
71 | 71 | },
|
72 | 72 | {
|
73 | 73 | "cell_type": "code",
|
74 |
| - "execution_count": null, |
| 74 | + "execution_count": 1, |
75 | 75 | "metadata": {},
|
76 | 76 | "outputs": [],
|
77 | 77 | "source": [
|
|
81 | 81 | },
|
82 | 82 | {
|
83 | 83 | "cell_type": "code",
|
84 |
| - "execution_count": null, |
| 84 | + "execution_count": 2, |
85 | 85 | "metadata": {},
|
86 | 86 | "outputs": [],
|
87 | 87 | "source": [
|
|
95 | 95 | },
|
96 | 96 | {
|
97 | 97 | "cell_type": "code",
|
98 |
| - "execution_count": null, |
| 98 | + "execution_count": 3, |
99 | 99 | "metadata": {},
|
100 |
| - "outputs": [], |
| 100 | + "outputs": [ |
| 101 | + { |
| 102 | + "data": { |
| 103 | + "text/plain": [ |
| 104 | + "{'id': 'no2-monthly',\n", |
| 105 | + " 'type': 'Collection',\n", |
| 106 | + " 'links': [{'rel': 'items',\n", |
| 107 | + " 'type': 'application/geo+json',\n", |
| 108 | + " 'href': 'https://openveda.cloud/api/stac/collections/no2-monthly/items'},\n", |
| 109 | + " {'rel': 'parent',\n", |
| 110 | + " 'type': 'application/json',\n", |
| 111 | + " 'href': 'https://openveda.cloud/api/stac/'},\n", |
| 112 | + " {'rel': 'root',\n", |
| 113 | + " 'type': 'application/json',\n", |
| 114 | + " 'href': 'https://openveda.cloud/api/stac/'},\n", |
| 115 | + " {'rel': 'self',\n", |
| 116 | + " 'type': 'application/json',\n", |
| 117 | + " 'href': 'https://openveda.cloud/api/stac/collections/no2-monthly'},\n", |
| 118 | + " {'rel': 'http://www.opengis.net/def/rel/ogc/1.0/queryables',\n", |
| 119 | + " 'type': 'application/schema+json',\n", |
| 120 | + " 'title': 'Queryables',\n", |
| 121 | + " 'href': 'https://openveda.cloud/api/stac/collections/no2-monthly/queryables'}],\n", |
| 122 | + " 'title': 'NO₂',\n", |
| 123 | + " 'assets': {'thumbnail': {'href': 'https://thumbnails.openveda.cloud/no2--dataset-cover.jpg',\n", |
| 124 | + " 'type': 'image/jpeg',\n", |
| 125 | + " 'roles': ['thumbnail'],\n", |
| 126 | + " 'title': 'Thumbnail',\n", |
| 127 | + " 'description': 'Photo by [Mick Truyts](https://unsplash.com/photos/x6WQeNYJC1w) (Power plant shooting steam at the sky)'}},\n", |
| 128 | + " 'extent': {'spatial': {'bbox': [[-180.0, -90.0, 180.0, 90.0]]},\n", |
| 129 | + " 'temporal': {'interval': [['2016-01-01T00:00:00+00:00',\n", |
| 130 | + " '2022-12-31T00:00:00+00:00']]}},\n", |
| 131 | + " 'license': 'MIT',\n", |
| 132 | + " 'renders': {'dashboard': {'bidx': [1],\n", |
| 133 | + " 'title': 'VEDA Dashboard Render Parameters',\n", |
| 134 | + " 'assets': ['cog_default'],\n", |
| 135 | + " 'rescale': [[0, 15000000000000000]],\n", |
| 136 | + " 'resampling': 'bilinear',\n", |
| 137 | + " 'color_formula': 'gamma r 1.05',\n", |
| 138 | + " 'colormap_name': 'rdbu_r'}},\n", |
| 139 | + " 'providers': [{'url': 'https://disc.gsfc.nasa.gov/',\n", |
| 140 | + " 'name': 'NASA Goddard Earth Sciences Data and Information Services Center',\n", |
| 141 | + " 'roles': ['producer', 'processor']},\n", |
| 142 | + " {'url': 'https://www.earthdata.nasa.gov/dashboard/',\n", |
| 143 | + " 'name': 'NASA VEDA',\n", |
| 144 | + " 'roles': ['host']}],\n", |
| 145 | + " 'summaries': {'datetime': ['2016-01-01T00:00:00Z', '2023-09-30T00:00:00Z']},\n", |
| 146 | + " 'description': 'Darker colors indicate higher nitrogen dioxide (NO₂) levels and more activity. Lighter colors indicate lower levels of NO₂ and less activity. Missing pixels indicate areas of no data most likely associated with cloud cover or snow.',\n", |
| 147 | + " 'item_assets': {'cog_default': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized',\n", |
| 148 | + " 'roles': ['data', 'layer'],\n", |
| 149 | + " 'title': 'Default COG Layer',\n", |
| 150 | + " 'description': 'Cloud optimized default layer to display on map'}},\n", |
| 151 | + " 'stac_version': '1.0.0',\n", |
| 152 | + " 'stac_extensions': ['https://stac-extensions.github.io/item-assets/v1.0.0/schema.json',\n", |
| 153 | + " 'https://stac-extensions.github.io/render/v1.0.0/schema.json'],\n", |
| 154 | + " 'dashboard:is_periodic': True,\n", |
| 155 | + " 'dashboard:time_density': 'month'}" |
| 156 | + ] |
| 157 | + }, |
| 158 | + "execution_count": 3, |
| 159 | + "metadata": {}, |
| 160 | + "output_type": "execute_result" |
| 161 | + } |
| 162 | + ], |
101 | 163 | "source": [
|
102 | 164 | "#Fetch STAC collection\n",
|
103 | 165 | "collection = requests.get(f\"{STAC_API_URL}/collections/{collection_name}\").json()\n",
|
|
114 | 176 | },
|
115 | 177 | {
|
116 | 178 | "cell_type": "code",
|
117 |
| - "execution_count": null, |
| 179 | + "execution_count": 4, |
118 | 180 | "metadata": {},
|
119 |
| - "outputs": [], |
| 181 | + "outputs": [ |
| 182 | + { |
| 183 | + "name": "stdout", |
| 184 | + "output_type": "stream", |
| 185 | + "text": [ |
| 186 | + "Found 93 items\n" |
| 187 | + ] |
| 188 | + } |
| 189 | + ], |
120 | 190 | "source": [
|
121 | 191 | "# Check total number of items available\n",
|
122 | 192 | "items = requests.get(f\"{STAC_API_URL}/collections/{collection_name}/items?limit=100\").json()[\"features\"]\n",
|
|
135 | 205 | },
|
136 | 206 | {
|
137 | 207 | "cell_type": "code",
|
138 |
| - "execution_count": null, |
| 208 | + "execution_count": 5, |
139 | 209 | "metadata": {},
|
140 | 210 | "outputs": [],
|
141 | 211 | "source": [
|
|
157 | 227 | },
|
158 | 228 | {
|
159 | 229 | "cell_type": "code",
|
160 |
| - "execution_count": null, |
| 230 | + "execution_count": 6, |
161 | 231 | "metadata": {},
|
162 | 232 | "outputs": [],
|
163 | 233 | "source": [
|
|
175 | 245 | },
|
176 | 246 | {
|
177 | 247 | "cell_type": "code",
|
178 |
| - "execution_count": null, |
| 248 | + "execution_count": 7, |
179 | 249 | "metadata": {},
|
180 |
| - "outputs": [], |
| 250 | + "outputs": [ |
| 251 | + { |
| 252 | + "data": { |
| 253 | + "text/plain": [ |
| 254 | + "{'tilejson': '2.2.0',\n", |
| 255 | + " 'version': '1.0.0',\n", |
| 256 | + " 'scheme': 'xyz',\n", |
| 257 | + " 'tiles': ['https://openveda.cloud/api/raster/collections/no2-monthly/items/OMI_trno2_0.10x0.10_202002_Col3_V4.nc/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?assets=cog_default&color_formula=gamma+r+1.05&colormap_name=cool&rescale=-1018382487283302%2C50064805976866816'],\n", |
| 258 | + " 'minzoom': 0,\n", |
| 259 | + " 'maxzoom': 24,\n", |
| 260 | + " 'bounds': [-180.0, -90.0, 180.0, 90.0],\n", |
| 261 | + " 'center': [0.0, 0.0, 0]}" |
| 262 | + ] |
| 263 | + }, |
| 264 | + "execution_count": 7, |
| 265 | + "metadata": {}, |
| 266 | + "output_type": "execute_result" |
| 267 | + } |
| 268 | + ], |
181 | 269 | "source": [
|
182 | 270 | "february_2020_tile = requests.get(\n",
|
183 | 271 | " f\"{RASTER_API_URL}/collections/{items['2020-02']['collection']}/items/{items['2020-02']['id']}/WebMercatorQuad/tilejson.json?\"\n",
|
|
190 | 278 | },
|
191 | 279 | {
|
192 | 280 | "cell_type": "code",
|
193 |
| - "execution_count": null, |
| 281 | + "execution_count": 8, |
194 | 282 | "metadata": {},
|
195 |
| - "outputs": [], |
| 283 | + "outputs": [ |
| 284 | + { |
| 285 | + "data": { |
| 286 | + "text/plain": [ |
| 287 | + "{'tilejson': '2.2.0',\n", |
| 288 | + " 'version': '1.0.0',\n", |
| 289 | + " 'scheme': 'xyz',\n", |
| 290 | + " 'tiles': ['https://openveda.cloud/api/raster/collections/no2-monthly/items/OMI_trno2_0.10x0.10_202202_Col3_V4.nc/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?assets=cog_default&color_formula=gamma+r+1.05&colormap_name=cool&rescale=-1018382487283302%2C50064805976866816'],\n", |
| 291 | + " 'minzoom': 0,\n", |
| 292 | + " 'maxzoom': 24,\n", |
| 293 | + " 'bounds': [-180.0, -90.0, 180.0, 90.0],\n", |
| 294 | + " 'center': [0.0, 0.0, 0]}" |
| 295 | + ] |
| 296 | + }, |
| 297 | + "execution_count": 8, |
| 298 | + "metadata": {}, |
| 299 | + "output_type": "execute_result" |
| 300 | + } |
| 301 | + ], |
196 | 302 | "source": [
|
197 | 303 | "february_2022_tile = requests.get(\n",
|
198 | 304 | " f\"{RASTER_API_URL}/collections/{items['2022-02']['collection']}/items/{items['2022-02']['id']}/WebMercatorQuad/tilejson.json?\"\n",
|
|
217 | 323 | },
|
218 | 324 | {
|
219 | 325 | "cell_type": "code",
|
220 |
| - "execution_count": null, |
| 326 | + "execution_count": 9, |
221 | 327 | "metadata": {},
|
222 |
| - "outputs": [], |
| 328 | + "outputs": [ |
| 329 | + { |
| 330 | + "data": { |
| 331 | + "text/html": [ |
| 332 | + "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n", |
| 333 | + "<html>\n", |
| 334 | + "<head>\n", |
| 335 | + " \n", |
| 336 | + " <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n", |
| 337 | + " \n", |
| 338 | + " <script>\n", |
| 339 | + " L_NO_TOUCH = false;\n", |
| 340 | + " L_DISABLE_3D = false;\n", |
| 341 | + " </script>\n", |
| 342 | + " \n", |
| 343 | + " <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n", |
| 344 | + " <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n", |
| 345 | + " <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js"></script>\n", |
| 346 | + " <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>\n", |
| 347 | + " <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>\n", |
| 348 | + " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n", |
| 349 | + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css"/>\n", |
| 350 | + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"/>\n", |
| 351 | + " <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css"/>\n", |
| 352 | + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css"/>\n", |
| 353 | + " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n", |
| 354 | + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n", |
| 355 | + " \n", |
| 356 | + " <meta name="viewport" content="width=device-width,\n", |
| 357 | + " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", |
| 358 | + " <style>\n", |
| 359 | + " #map_5c580dfb463638fd141c9f35e26e764a {\n", |
| 360 | + " position: absolute;\n", |
| 361 | + " width: 50.0%;\n", |
| 362 | + " height: 100.0%;\n", |
| 363 | + " left: 0.0%;\n", |
| 364 | + " top: 0.0%;\n", |
| 365 | + " }\n", |
| 366 | + " .leaflet-container { font-size: 1rem; }\n", |
| 367 | + " </style>\n", |
| 368 | + " \n", |
| 369 | + " \n", |
| 370 | + " <meta name="viewport" content="width=device-width,\n", |
| 371 | + " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", |
| 372 | + " <style>\n", |
| 373 | + " #map_182773b58f4c85e85d56761b3fdd307b {\n", |
| 374 | + " position: absolute;\n", |
| 375 | + " width: 50.0%;\n", |
| 376 | + " height: 100.0%;\n", |
| 377 | + " left: 50.0%;\n", |
| 378 | + " top: 0.0%;\n", |
| 379 | + " }\n", |
| 380 | + " .leaflet-container { font-size: 1rem; }\n", |
| 381 | + " </style>\n", |
| 382 | + " \n", |
| 383 | + " <script src="https://cdn.jsdelivr.net/gh/jieter/Leaflet.Sync/L.Map.Sync.min.js"></script>\n", |
| 384 | + "</head>\n", |
| 385 | + "<body>\n", |
| 386 | + " \n", |
| 387 | + " \n", |
| 388 | + " <div class="folium-map" id="map_5c580dfb463638fd141c9f35e26e764a" ></div>\n", |
| 389 | + " \n", |
| 390 | + " \n", |
| 391 | + " <div class="folium-map" id="map_182773b58f4c85e85d56761b3fdd307b" ></div>\n", |
| 392 | + " \n", |
| 393 | + "</body>\n", |
| 394 | + "<script>\n", |
| 395 | + " \n", |
| 396 | + " \n", |
| 397 | + " var map_5c580dfb463638fd141c9f35e26e764a = L.map(\n", |
| 398 | + " "map_5c580dfb463638fd141c9f35e26e764a",\n", |
| 399 | + " {\n", |
| 400 | + " center: [33.6901, 118.9325],\n", |
| 401 | + " crs: L.CRS.EPSG3857,\n", |
| 402 | + " zoom: 5,\n", |
| 403 | + " zoomControl: true,\n", |
| 404 | + " preferCanvas: false,\n", |
| 405 | + " }\n", |
| 406 | + " );\n", |
| 407 | + "\n", |
| 408 | + " \n", |
| 409 | + "\n", |
| 410 | + " \n", |
| 411 | + " \n", |
| 412 | + " var tile_layer_d7403ada74d0a75486a18ee0b5f43416 = L.tileLayer(\n", |
| 413 | + " "https://tile.openstreetmap.org/{z}/{x}/{y}.png",\n", |
| 414 | + " {"attribution": "\\u0026copy; \\u003ca href=\\"https://www.openstreetmap.org/copyright\\"\\u003eOpenStreetMap\\u003c/a\\u003e contributors", "detectRetina": false, "maxNativeZoom": 19, "maxZoom": 19, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", |
| 415 | + " );\n", |
| 416 | + " \n", |
| 417 | + " \n", |
| 418 | + " tile_layer_d7403ada74d0a75486a18ee0b5f43416.addTo(map_5c580dfb463638fd141c9f35e26e764a);\n", |
| 419 | + " \n", |
| 420 | + " \n", |
| 421 | + " var tile_layer_5785cc3f5a418b0e27c8bd61af058158 = L.tileLayer(\n", |
| 422 | + " "https://openveda.cloud/api/raster/collections/no2-monthly/items/OMI_trno2_0.10x0.10_202002_Col3_V4.nc/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?assets=cog_default\\u0026color_formula=gamma+r+1.05\\u0026colormap_name=cool\\u0026rescale=-1018382487283302%2C50064805976866816",\n", |
| 423 | + " {"attribution": "VEDA", "detectRetina": false, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 0.8, "subdomains": "abc", "tms": false}\n", |
| 424 | + " );\n", |
| 425 | + " \n", |
| 426 | + " \n", |
| 427 | + " tile_layer_5785cc3f5a418b0e27c8bd61af058158.addTo(map_5c580dfb463638fd141c9f35e26e764a);\n", |
| 428 | + " \n", |
| 429 | + " \n", |
| 430 | + " var map_182773b58f4c85e85d56761b3fdd307b = L.map(\n", |
| 431 | + " "map_182773b58f4c85e85d56761b3fdd307b",\n", |
| 432 | + " {\n", |
| 433 | + " center: [33.6901, 118.9325],\n", |
| 434 | + " crs: L.CRS.EPSG3857,\n", |
| 435 | + " zoom: 5,\n", |
| 436 | + " zoomControl: true,\n", |
| 437 | + " preferCanvas: false,\n", |
| 438 | + " }\n", |
| 439 | + " );\n", |
| 440 | + "\n", |
| 441 | + " \n", |
| 442 | + "\n", |
| 443 | + " \n", |
| 444 | + " \n", |
| 445 | + " var tile_layer_223fcae3834456c7abbdbc4f06b72f0c = L.tileLayer(\n", |
| 446 | + " "https://tile.openstreetmap.org/{z}/{x}/{y}.png",\n", |
| 447 | + " {"attribution": "\\u0026copy; \\u003ca href=\\"https://www.openstreetmap.org/copyright\\"\\u003eOpenStreetMap\\u003c/a\\u003e contributors", "detectRetina": false, "maxNativeZoom": 19, "maxZoom": 19, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", |
| 448 | + " );\n", |
| 449 | + " \n", |
| 450 | + " \n", |
| 451 | + " tile_layer_223fcae3834456c7abbdbc4f06b72f0c.addTo(map_182773b58f4c85e85d56761b3fdd307b);\n", |
| 452 | + " \n", |
| 453 | + " \n", |
| 454 | + " var tile_layer_20b594d3b02cb64d2f08f778883e20a4 = L.tileLayer(\n", |
| 455 | + " "https://openveda.cloud/api/raster/collections/no2-monthly/items/OMI_trno2_0.10x0.10_202202_Col3_V4.nc/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?assets=cog_default\\u0026color_formula=gamma+r+1.05\\u0026colormap_name=cool\\u0026rescale=-1018382487283302%2C50064805976866816",\n", |
| 456 | + " {"attribution": "VEDA", "detectRetina": false, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 0.8, "subdomains": "abc", "tms": false}\n", |
| 457 | + " );\n", |
| 458 | + " \n", |
| 459 | + " \n", |
| 460 | + " tile_layer_20b594d3b02cb64d2f08f778883e20a4.addTo(map_182773b58f4c85e85d56761b3fdd307b);\n", |
| 461 | + " \n", |
| 462 | + " \n", |
| 463 | + " map_5c580dfb463638fd141c9f35e26e764a.sync(map_182773b58f4c85e85d56761b3fdd307b);\n", |
| 464 | + " map_182773b58f4c85e85d56761b3fdd307b.sync(map_5c580dfb463638fd141c9f35e26e764a);\n", |
| 465 | + " \n", |
| 466 | + "</script>\n", |
| 467 | + "</html>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" |
| 468 | + ], |
| 469 | + "text/plain": [ |
| 470 | + "<folium.plugins.dual_map.DualMap at 0x7f8058b99c40>" |
| 471 | + ] |
| 472 | + }, |
| 473 | + "execution_count": 9, |
| 474 | + "metadata": {}, |
| 475 | + "output_type": "execute_result" |
| 476 | + } |
| 477 | + ], |
223 | 478 | "source": [
|
224 | 479 | "# We'll import folium to map and folium.plugins to allow mapping side-by-side\n",
|
225 | 480 | "import folium\n",
|
|
0 commit comments