|
36 | 36 | "## Approach\n",
|
37 | 37 | "\n",
|
38 | 38 | " 1. Identify available dates and temporal frequency of observations for a given collection - NO₂\n",
|
39 |
| - " 2. Pass the STAC item into raster API `/stac/tilejson.json` endpoint\n", |
| 39 | + " 2. Pass the STAC item into raster API `collections` endpoint\n", |
40 | 40 | " 3. We'll visualize two tiles (side-by-side) allowing for comparison of each of the time points using `folium.plugins.DualMap`\n",
|
41 | 41 | " "
|
42 | 42 | ]
|
|
114 | 114 | " 'href': 'https://openveda.cloud/api/stac/'},\n",
|
115 | 115 | " {'rel': 'self',\n",
|
116 | 116 | " 'type': 'application/json',\n",
|
117 |
| - " 'href': 'https://openveda.cloud/api/stac/collections/no2-monthly'}],\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", |
118 | 122 | " 'title': 'NO₂',\n",
|
119 | 123 | " 'assets': {'thumbnail': {'href': 'https://thumbnails.openveda.cloud/no2--dataset-cover.jpg',\n",
|
120 | 124 | " 'type': 'image/jpeg',\n",
|
|
167 | 171 | "cell_type": "markdown",
|
168 | 172 | "metadata": {},
|
169 | 173 | "source": [
|
170 |
| - "Examining the contents of our `collection` under `summaries` we see that the data is available from January 2015 to December 2022. By looking at the `dashboard:time density` we observe that the periodic frequency of these observations is monthly. " |
| 174 | + "Examining the contents of our `collection` under `summaries` we see that the data is available from January 2015 to September 2023. By looking at the `dashboard:time density` we observe that the periodic frequency of these observations is monthly. " |
171 | 175 | ]
|
172 | 176 | },
|
173 | 177 | {
|
|
194 | 198 | "cell_type": "markdown",
|
195 | 199 | "metadata": {},
|
196 | 200 | "source": [
|
197 |
| - "This makes sense as there are 7 years between 2016 - 2022, with 12 months per year, meaning 84 records in total. \n", |
| 201 | + "This makes sense as there are 8 years between 2016 - 2023, with 12 months per year, meaning 96 possible records. Since our dataset ends in September, we subtract 3 months to give us a total of 93 items.\n", |
198 | 202 | "\n",
|
199 | 203 | "Below, we'll provide the max range of values to apply to visualizations of all items in the collection (`rescale_values`). "
|
200 | 204 | ]
|
|
250 | 254 | "{'tilejson': '2.2.0',\n",
|
251 | 255 | " 'version': '1.0.0',\n",
|
252 | 256 | " 'scheme': 'xyz',\n",
|
253 |
| - " 'tiles': ['https://openveda.cloud/api/raster/stac/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=no2-monthly&item=OMI_trno2_0.10x0.10_202002_Col3_V4.nc&assets=cog_default&color_formula=gamma+r+1.05&colormap_name=cool&rescale=-1018382487283302%2C50064805976866816'],\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", |
254 | 258 | " 'minzoom': 0,\n",
|
255 | 259 | " 'maxzoom': 24,\n",
|
256 | 260 | " 'bounds': [-180.0, -90.0, 180.0, 90.0],\n",
|
|
264 | 268 | ],
|
265 | 269 | "source": [
|
266 | 270 | "february_2020_tile = requests.get(\n",
|
267 |
| - " f\"{RASTER_API_URL}/stac/tilejson.json?collection={items['2020-02']['collection']}&item={items['2020-02']['id']}\"\n", |
| 271 | + " f\"{RASTER_API_URL}/collections/{items['2020-02']['collection']}/items/{items['2020-02']['id']}/WebMercatorQuad/tilejson.json?\"\n", |
268 | 272 | " \"&assets=cog_default\"\n",
|
269 | 273 | " \"&color_formula=gamma+r+1.05&colormap_name=cool\"\n",
|
270 | 274 | " f\"&rescale={rescale_values['min']},{rescale_values['max']}\", \n",
|
|
283 | 287 | "{'tilejson': '2.2.0',\n",
|
284 | 288 | " 'version': '1.0.0',\n",
|
285 | 289 | " 'scheme': 'xyz',\n",
|
286 |
| - " 'tiles': ['https://openveda.cloud/api/raster/stac/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=no2-monthly&item=OMI_trno2_0.10x0.10_202202_Col3_V4.nc&assets=cog_default&color_formula=gamma+r+1.05&colormap_name=cool&rescale=-1018382487283302%2C50064805976866816'],\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", |
287 | 291 | " 'minzoom': 0,\n",
|
288 | 292 | " 'maxzoom': 24,\n",
|
289 | 293 | " 'bounds': [-180.0, -90.0, 180.0, 90.0],\n",
|
|
297 | 301 | ],
|
298 | 302 | "source": [
|
299 | 303 | "february_2022_tile = requests.get(\n",
|
300 |
| - " f\"{RASTER_API_URL}/stac/tilejson.json?collection={items['2022-02']['collection']}&item={items['2022-02']['id']}\"\n", |
| 304 | + " f\"{RASTER_API_URL}/collections/{items['2022-02']['collection']}/items/{items['2022-02']['id']}/WebMercatorQuad/tilejson.json?\"\n", |
301 | 305 | " \"&assets=cog_default\"\n",
|
302 | 306 | " \"&color_formula=gamma+r+1.05&colormap_name=cool\"\n",
|
303 | 307 | " f\"&rescale={rescale_values['min']},{rescale_values['max']}\", \n",
|
|
344 | 348 | " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n",
|
345 | 349 | " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css"/>\n",
|
346 | 350 | " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"/>\n",
|
347 |
| - " <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"/>\n", |
| 351 | + " <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css"/>\n", |
348 | 352 | " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css"/>\n",
|
349 | 353 | " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n",
|
350 | 354 | " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n",
|
351 | 355 | " \n",
|
352 | 356 | " <meta name="viewport" content="width=device-width,\n",
|
353 | 357 | " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n",
|
354 | 358 | " <style>\n",
|
355 |
| - " #map_e32927666b28d271958699eb75c9b3de {\n", |
| 359 | + " #map_5c580dfb463638fd141c9f35e26e764a {\n", |
356 | 360 | " position: absolute;\n",
|
357 | 361 | " width: 50.0%;\n",
|
358 | 362 | " height: 100.0%;\n",
|
|
366 | 370 | " <meta name="viewport" content="width=device-width,\n",
|
367 | 371 | " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n",
|
368 | 372 | " <style>\n",
|
369 |
| - " #map_bbaf0c0bd1a55e590749e405c5e26755 {\n", |
| 373 | + " #map_182773b58f4c85e85d56761b3fdd307b {\n", |
370 | 374 | " position: absolute;\n",
|
371 | 375 | " width: 50.0%;\n",
|
372 | 376 | " height: 100.0%;\n",
|
|
381 | 385 | "<body>\n",
|
382 | 386 | " \n",
|
383 | 387 | " \n",
|
384 |
| - " <div class="folium-map" id="map_e32927666b28d271958699eb75c9b3de" ></div>\n", |
| 388 | + " <div class="folium-map" id="map_5c580dfb463638fd141c9f35e26e764a" ></div>\n", |
385 | 389 | " \n",
|
386 | 390 | " \n",
|
387 |
| - " <div class="folium-map" id="map_bbaf0c0bd1a55e590749e405c5e26755" ></div>\n", |
| 391 | + " <div class="folium-map" id="map_182773b58f4c85e85d56761b3fdd307b" ></div>\n", |
388 | 392 | " \n",
|
389 | 393 | "</body>\n",
|
390 | 394 | "<script>\n",
|
391 | 395 | " \n",
|
392 | 396 | " \n",
|
393 |
| - " var map_e32927666b28d271958699eb75c9b3de = L.map(\n", |
394 |
| - " "map_e32927666b28d271958699eb75c9b3de",\n", |
| 397 | + " var map_5c580dfb463638fd141c9f35e26e764a = L.map(\n", |
| 398 | + " "map_5c580dfb463638fd141c9f35e26e764a",\n", |
395 | 399 | " {\n",
|
396 | 400 | " center: [33.6901, 118.9325],\n",
|
397 | 401 | " crs: L.CRS.EPSG3857,\n",
|
|
405 | 409 | "\n",
|
406 | 410 | " \n",
|
407 | 411 | " \n",
|
408 |
| - " var tile_layer_43eced198f351a1c0d707a9014da2382 = L.tileLayer(\n", |
| 412 | + " var tile_layer_d7403ada74d0a75486a18ee0b5f43416 = L.tileLayer(\n", |
409 | 413 | " "https://tile.openstreetmap.org/{z}/{x}/{y}.png",\n",
|
410 | 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",
|
411 | 415 | " );\n",
|
412 | 416 | " \n",
|
413 | 417 | " \n",
|
414 |
| - " tile_layer_43eced198f351a1c0d707a9014da2382.addTo(map_e32927666b28d271958699eb75c9b3de);\n", |
| 418 | + " tile_layer_d7403ada74d0a75486a18ee0b5f43416.addTo(map_5c580dfb463638fd141c9f35e26e764a);\n", |
415 | 419 | " \n",
|
416 | 420 | " \n",
|
417 |
| - " var tile_layer_88bc1f63e04a991c779b5da7850e12cb = L.tileLayer(\n", |
418 |
| - " "https://openveda.cloud/api/raster/stac/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=no2-monthly\\u0026item=OMI_trno2_0.10x0.10_202002_Col3_V4.nc\\u0026assets=cog_default\\u0026color_formula=gamma+r+1.05\\u0026colormap_name=cool\\u0026rescale=-1018382487283302%2C50064805976866816",\n", |
419 |
| - " {"attribution": "VEDA", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 0.8, "subdomains": "abc", "tms": false}\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", |
420 | 424 | " );\n",
|
421 | 425 | " \n",
|
422 | 426 | " \n",
|
423 |
| - " tile_layer_88bc1f63e04a991c779b5da7850e12cb.addTo(map_e32927666b28d271958699eb75c9b3de);\n", |
| 427 | + " tile_layer_5785cc3f5a418b0e27c8bd61af058158.addTo(map_5c580dfb463638fd141c9f35e26e764a);\n", |
424 | 428 | " \n",
|
425 | 429 | " \n",
|
426 |
| - " var map_bbaf0c0bd1a55e590749e405c5e26755 = L.map(\n", |
427 |
| - " "map_bbaf0c0bd1a55e590749e405c5e26755",\n", |
| 430 | + " var map_182773b58f4c85e85d56761b3fdd307b = L.map(\n", |
| 431 | + " "map_182773b58f4c85e85d56761b3fdd307b",\n", |
428 | 432 | " {\n",
|
429 | 433 | " center: [33.6901, 118.9325],\n",
|
430 | 434 | " crs: L.CRS.EPSG3857,\n",
|
|
438 | 442 | "\n",
|
439 | 443 | " \n",
|
440 | 444 | " \n",
|
441 |
| - " var tile_layer_60683b9265ccf303db1f8fcbff7b5bdb = L.tileLayer(\n", |
| 445 | + " var tile_layer_223fcae3834456c7abbdbc4f06b72f0c = L.tileLayer(\n", |
442 | 446 | " "https://tile.openstreetmap.org/{z}/{x}/{y}.png",\n",
|
443 | 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",
|
444 | 448 | " );\n",
|
445 | 449 | " \n",
|
446 | 450 | " \n",
|
447 |
| - " tile_layer_60683b9265ccf303db1f8fcbff7b5bdb.addTo(map_bbaf0c0bd1a55e590749e405c5e26755);\n", |
| 451 | + " tile_layer_223fcae3834456c7abbdbc4f06b72f0c.addTo(map_182773b58f4c85e85d56761b3fdd307b);\n", |
448 | 452 | " \n",
|
449 | 453 | " \n",
|
450 |
| - " var tile_layer_ca6be6d014cdfc7a72ce05073ade86d6 = L.tileLayer(\n", |
451 |
| - " "https://openveda.cloud/api/raster/stac/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=no2-monthly\\u0026item=OMI_trno2_0.10x0.10_202202_Col3_V4.nc\\u0026assets=cog_default\\u0026color_formula=gamma+r+1.05\\u0026colormap_name=cool\\u0026rescale=-1018382487283302%2C50064805976866816",\n", |
452 |
| - " {"attribution": "VEDA", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 0.8, "subdomains": "abc", "tms": false}\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", |
453 | 457 | " );\n",
|
454 | 458 | " \n",
|
455 | 459 | " \n",
|
456 |
| - " tile_layer_ca6be6d014cdfc7a72ce05073ade86d6.addTo(map_bbaf0c0bd1a55e590749e405c5e26755);\n", |
| 460 | + " tile_layer_20b594d3b02cb64d2f08f778883e20a4.addTo(map_182773b58f4c85e85d56761b3fdd307b);\n", |
457 | 461 | " \n",
|
458 | 462 | " \n",
|
459 |
| - " map_e32927666b28d271958699eb75c9b3de.sync(map_bbaf0c0bd1a55e590749e405c5e26755);\n", |
460 |
| - " map_bbaf0c0bd1a55e590749e405c5e26755.sync(map_e32927666b28d271958699eb75c9b3de);\n", |
| 463 | + " map_5c580dfb463638fd141c9f35e26e764a.sync(map_182773b58f4c85e85d56761b3fdd307b);\n", |
| 464 | + " map_182773b58f4c85e85d56761b3fdd307b.sync(map_5c580dfb463638fd141c9f35e26e764a);\n", |
461 | 465 | " \n",
|
462 | 466 | "</script>\n",
|
463 | 467 | "</html>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
|
464 | 468 | ],
|
465 | 469 | "text/plain": [
|
466 |
| - "<folium.plugins.dual_map.DualMap at 0x7ff8ceff3bd0>" |
| 470 | + "<folium.plugins.dual_map.DualMap at 0x7f8058b99c40>" |
467 | 471 | ]
|
468 | 472 | },
|
469 | 473 | "execution_count": 9,
|
|
526 | 530 | "name": "python",
|
527 | 531 | "nbconvert_exporter": "python",
|
528 | 532 | "pygments_lexer": "ipython3",
|
529 |
| - "version": "3.11.9" |
| 533 | + "version": "3.12.7" |
530 | 534 | }
|
531 | 535 | },
|
532 | 536 | "nbformat": 4,
|
|
0 commit comments