Skip to content

Commit 09305db

Browse files
Merge pull request #207 from NASA-IMPACT/collectionUpdate
fix: update Raster api tilejson url for additional datasets
2 parents 282d802 + 6ae754b commit 09305db

File tree

2 files changed

+86
-85
lines changed

2 files changed

+86
-85
lines changed

user-guide/notebooks/datasets/air-quality-covid.ipynb

+37-33
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"## Approach\n",
3737
"\n",
3838
" 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",
4040
" 3. We'll visualize two tiles (side-by-side) allowing for comparison of each of the time points using `folium.plugins.DualMap`\n",
4141
" "
4242
]
@@ -114,7 +114,11 @@
114114
" 'href': 'https://openveda.cloud/api/stac/'},\n",
115115
" {'rel': 'self',\n",
116116
" '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",
118122
" 'title': 'NO₂',\n",
119123
" 'assets': {'thumbnail': {'href': 'https://thumbnails.openveda.cloud/no2--dataset-cover.jpg',\n",
120124
" 'type': 'image/jpeg',\n",
@@ -167,7 +171,7 @@
167171
"cell_type": "markdown",
168172
"metadata": {},
169173
"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. "
171175
]
172176
},
173177
{
@@ -194,7 +198,7 @@
194198
"cell_type": "markdown",
195199
"metadata": {},
196200
"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",
198202
"\n",
199203
"Below, we'll provide the max range of values to apply to visualizations of all items in the collection (`rescale_values`). "
200204
]
@@ -250,7 +254,7 @@
250254
"{'tilejson': '2.2.0',\n",
251255
" 'version': '1.0.0',\n",
252256
" '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",
254258
" 'minzoom': 0,\n",
255259
" 'maxzoom': 24,\n",
256260
" 'bounds': [-180.0, -90.0, 180.0, 90.0],\n",
@@ -264,7 +268,7 @@
264268
],
265269
"source": [
266270
"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",
268272
" \"&assets=cog_default\"\n",
269273
" \"&color_formula=gamma+r+1.05&colormap_name=cool\"\n",
270274
" f\"&rescale={rescale_values['min']},{rescale_values['max']}\", \n",
@@ -283,7 +287,7 @@
283287
"{'tilejson': '2.2.0',\n",
284288
" 'version': '1.0.0',\n",
285289
" '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",
287291
" 'minzoom': 0,\n",
288292
" 'maxzoom': 24,\n",
289293
" 'bounds': [-180.0, -90.0, 180.0, 90.0],\n",
@@ -297,7 +301,7 @@
297301
],
298302
"source": [
299303
"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",
301305
" \"&assets=cog_default\"\n",
302306
" \"&color_formula=gamma+r+1.05&colormap_name=cool\"\n",
303307
" f\"&rescale={rescale_values['min']},{rescale_values['max']}\", \n",
@@ -344,15 +348,15 @@
344348
" <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n",
345349
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css"/>\n",
346350
" <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",
348352
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css"/>\n",
349353
" <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n",
350354
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n",
351355
" \n",
352356
" <meta name="viewport" content="width=device-width,\n",
353357
" initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n",
354358
" <style>\n",
355-
" #map_e32927666b28d271958699eb75c9b3de {\n",
359+
" #map_5c580dfb463638fd141c9f35e26e764a {\n",
356360
" position: absolute;\n",
357361
" width: 50.0%;\n",
358362
" height: 100.0%;\n",
@@ -366,7 +370,7 @@
366370
" <meta name="viewport" content="width=device-width,\n",
367371
" initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n",
368372
" <style>\n",
369-
" #map_bbaf0c0bd1a55e590749e405c5e26755 {\n",
373+
" #map_182773b58f4c85e85d56761b3fdd307b {\n",
370374
" position: absolute;\n",
371375
" width: 50.0%;\n",
372376
" height: 100.0%;\n",
@@ -381,17 +385,17 @@
381385
"<body>\n",
382386
" \n",
383387
" \n",
384-
" <div class="folium-map" id="map_e32927666b28d271958699eb75c9b3de" ></div>\n",
388+
" <div class="folium-map" id="map_5c580dfb463638fd141c9f35e26e764a" ></div>\n",
385389
" \n",
386390
" \n",
387-
" <div class="folium-map" id="map_bbaf0c0bd1a55e590749e405c5e26755" ></div>\n",
391+
" <div class="folium-map" id="map_182773b58f4c85e85d56761b3fdd307b" ></div>\n",
388392
" \n",
389393
"</body>\n",
390394
"<script>\n",
391395
" \n",
392396
" \n",
393-
" var map_e32927666b28d271958699eb75c9b3de = L.map(\n",
394-
" "map_e32927666b28d271958699eb75c9b3de",\n",
397+
" var map_5c580dfb463638fd141c9f35e26e764a = L.map(\n",
398+
" "map_5c580dfb463638fd141c9f35e26e764a",\n",
395399
" {\n",
396400
" center: [33.6901, 118.9325],\n",
397401
" crs: L.CRS.EPSG3857,\n",
@@ -405,26 +409,26 @@
405409
"\n",
406410
" \n",
407411
" \n",
408-
" var tile_layer_43eced198f351a1c0d707a9014da2382 = L.tileLayer(\n",
412+
" var tile_layer_d7403ada74d0a75486a18ee0b5f43416 = L.tileLayer(\n",
409413
" "https://tile.openstreetmap.org/{z}/{x}/{y}.png",\n",
410414
" {"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",
411415
" );\n",
412416
" \n",
413417
" \n",
414-
" tile_layer_43eced198f351a1c0d707a9014da2382.addTo(map_e32927666b28d271958699eb75c9b3de);\n",
418+
" tile_layer_d7403ada74d0a75486a18ee0b5f43416.addTo(map_5c580dfb463638fd141c9f35e26e764a);\n",
415419
" \n",
416420
" \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",
420424
" );\n",
421425
" \n",
422426
" \n",
423-
" tile_layer_88bc1f63e04a991c779b5da7850e12cb.addTo(map_e32927666b28d271958699eb75c9b3de);\n",
427+
" tile_layer_5785cc3f5a418b0e27c8bd61af058158.addTo(map_5c580dfb463638fd141c9f35e26e764a);\n",
424428
" \n",
425429
" \n",
426-
" var map_bbaf0c0bd1a55e590749e405c5e26755 = L.map(\n",
427-
" "map_bbaf0c0bd1a55e590749e405c5e26755",\n",
430+
" var map_182773b58f4c85e85d56761b3fdd307b = L.map(\n",
431+
" "map_182773b58f4c85e85d56761b3fdd307b",\n",
428432
" {\n",
429433
" center: [33.6901, 118.9325],\n",
430434
" crs: L.CRS.EPSG3857,\n",
@@ -438,32 +442,32 @@
438442
"\n",
439443
" \n",
440444
" \n",
441-
" var tile_layer_60683b9265ccf303db1f8fcbff7b5bdb = L.tileLayer(\n",
445+
" var tile_layer_223fcae3834456c7abbdbc4f06b72f0c = L.tileLayer(\n",
442446
" "https://tile.openstreetmap.org/{z}/{x}/{y}.png",\n",
443447
" {"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",
444448
" );\n",
445449
" \n",
446450
" \n",
447-
" tile_layer_60683b9265ccf303db1f8fcbff7b5bdb.addTo(map_bbaf0c0bd1a55e590749e405c5e26755);\n",
451+
" tile_layer_223fcae3834456c7abbdbc4f06b72f0c.addTo(map_182773b58f4c85e85d56761b3fdd307b);\n",
448452
" \n",
449453
" \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",
453457
" );\n",
454458
" \n",
455459
" \n",
456-
" tile_layer_ca6be6d014cdfc7a72ce05073ade86d6.addTo(map_bbaf0c0bd1a55e590749e405c5e26755);\n",
460+
" tile_layer_20b594d3b02cb64d2f08f778883e20a4.addTo(map_182773b58f4c85e85d56761b3fdd307b);\n",
457461
" \n",
458462
" \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",
461465
" \n",
462466
"</script>\n",
463467
"&lt;/html&gt;\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
464468
],
465469
"text/plain": [
466-
"<folium.plugins.dual_map.DualMap at 0x7ff8ceff3bd0>"
470+
"<folium.plugins.dual_map.DualMap at 0x7f8058b99c40>"
467471
]
468472
},
469473
"execution_count": 9,
@@ -526,7 +530,7 @@
526530
"name": "python",
527531
"nbconvert_exporter": "python",
528532
"pygments_lexer": "ipython3",
529-
"version": "3.11.9"
533+
"version": "3.12.7"
530534
}
531535
},
532536
"nbformat": 4,

0 commit comments

Comments
 (0)