Skip to content

Commit 6ae754b

Browse files
committed
update with imagery
1 parent 39ddc37 commit 6ae754b

File tree

2 files changed

+691
-34
lines changed

2 files changed

+691
-34
lines changed

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

+269-14
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
},
7272
{
7373
"cell_type": "code",
74-
"execution_count": null,
74+
"execution_count": 1,
7575
"metadata": {},
7676
"outputs": [],
7777
"source": [
@@ -81,7 +81,7 @@
8181
},
8282
{
8383
"cell_type": "code",
84-
"execution_count": null,
84+
"execution_count": 2,
8585
"metadata": {},
8686
"outputs": [],
8787
"source": [
@@ -95,9 +95,71 @@
9595
},
9696
{
9797
"cell_type": "code",
98-
"execution_count": null,
98+
"execution_count": 3,
9999
"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+
],
101163
"source": [
102164
"#Fetch STAC collection\n",
103165
"collection = requests.get(f\"{STAC_API_URL}/collections/{collection_name}\").json()\n",
@@ -114,9 +176,17 @@
114176
},
115177
{
116178
"cell_type": "code",
117-
"execution_count": null,
179+
"execution_count": 4,
118180
"metadata": {},
119-
"outputs": [],
181+
"outputs": [
182+
{
183+
"name": "stdout",
184+
"output_type": "stream",
185+
"text": [
186+
"Found 93 items\n"
187+
]
188+
}
189+
],
120190
"source": [
121191
"# Check total number of items available\n",
122192
"items = requests.get(f\"{STAC_API_URL}/collections/{collection_name}/items?limit=100\").json()[\"features\"]\n",
@@ -135,7 +205,7 @@
135205
},
136206
{
137207
"cell_type": "code",
138-
"execution_count": null,
208+
"execution_count": 5,
139209
"metadata": {},
140210
"outputs": [],
141211
"source": [
@@ -157,7 +227,7 @@
157227
},
158228
{
159229
"cell_type": "code",
160-
"execution_count": null,
230+
"execution_count": 6,
161231
"metadata": {},
162232
"outputs": [],
163233
"source": [
@@ -175,9 +245,27 @@
175245
},
176246
{
177247
"cell_type": "code",
178-
"execution_count": null,
248+
"execution_count": 7,
179249
"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+
],
181269
"source": [
182270
"february_2020_tile = requests.get(\n",
183271
" f\"{RASTER_API_URL}/collections/{items['2020-02']['collection']}/items/{items['2020-02']['id']}/WebMercatorQuad/tilejson.json?\"\n",
@@ -190,9 +278,27 @@
190278
},
191279
{
192280
"cell_type": "code",
193-
"execution_count": null,
281+
"execution_count": 8,
194282
"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+
],
196302
"source": [
197303
"february_2022_tile = requests.get(\n",
198304
" f\"{RASTER_API_URL}/collections/{items['2022-02']['collection']}/items/{items['2022-02']['id']}/WebMercatorQuad/tilejson.json?\"\n",
@@ -217,9 +323,158 @@
217323
},
218324
{
219325
"cell_type": "code",
220-
"execution_count": null,
326+
"execution_count": 9,
221327
"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=\"&lt;!DOCTYPE html&gt;\n",
333+
"&lt;html&gt;\n",
334+
"&lt;head&gt;\n",
335+
" \n",
336+
" &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;\n",
337+
" \n",
338+
" &lt;script&gt;\n",
339+
" L_NO_TOUCH = false;\n",
340+
" L_DISABLE_3D = false;\n",
341+
" &lt;/script&gt;\n",
342+
" \n",
343+
" &lt;style&gt;html, body {width: 100%;height: 100%;margin: 0;padding: 0;}&lt;/style&gt;\n",
344+
" &lt;style&gt;#map {position:absolute;top:0;bottom:0;right:0;left:0;}&lt;/style&gt;\n",
345+
" &lt;script src=&quot;https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js&quot;&gt;&lt;/script&gt;\n",
346+
" &lt;script src=&quot;https://code.jquery.com/jquery-3.7.1.min.js&quot;&gt;&lt;/script&gt;\n",
347+
" &lt;script src=&quot;https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js&quot;&gt;&lt;/script&gt;\n",
348+
" &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js&quot;&gt;&lt;/script&gt;\n",
349+
" &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css&quot;/&gt;\n",
350+
" &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css&quot;/&gt;\n",
351+
" &lt;link rel=&quot;stylesheet&quot; href=&quot;https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css&quot;/&gt;\n",
352+
" &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css&quot;/&gt;\n",
353+
" &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css&quot;/&gt;\n",
354+
" &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css&quot;/&gt;\n",
355+
" \n",
356+
" &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,\n",
357+
" initial-scale=1.0, maximum-scale=1.0, user-scalable=no&quot; /&gt;\n",
358+
" &lt;style&gt;\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+
" &lt;/style&gt;\n",
368+
" \n",
369+
" \n",
370+
" &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,\n",
371+
" initial-scale=1.0, maximum-scale=1.0, user-scalable=no&quot; /&gt;\n",
372+
" &lt;style&gt;\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+
" &lt;/style&gt;\n",
382+
" \n",
383+
" &lt;script src=&quot;https://cdn.jsdelivr.net/gh/jieter/Leaflet.Sync/L.Map.Sync.min.js&quot;&gt;&lt;/script&gt;\n",
384+
"&lt;/head&gt;\n",
385+
"&lt;body&gt;\n",
386+
" \n",
387+
" \n",
388+
" &lt;div class=&quot;folium-map&quot; id=&quot;map_5c580dfb463638fd141c9f35e26e764a&quot; &gt;&lt;/div&gt;\n",
389+
" \n",
390+
" \n",
391+
" &lt;div class=&quot;folium-map&quot; id=&quot;map_182773b58f4c85e85d56761b3fdd307b&quot; &gt;&lt;/div&gt;\n",
392+
" \n",
393+
"&lt;/body&gt;\n",
394+
"&lt;script&gt;\n",
395+
" \n",
396+
" \n",
397+
" var map_5c580dfb463638fd141c9f35e26e764a = L.map(\n",
398+
" &quot;map_5c580dfb463638fd141c9f35e26e764a&quot;,\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+
" &quot;https://tile.openstreetmap.org/{z}/{x}/{y}.png&quot;,\n",
414+
" {&quot;attribution&quot;: &quot;\\u0026copy; \\u003ca href=\\&quot;https://www.openstreetmap.org/copyright\\&quot;\\u003eOpenStreetMap\\u003c/a\\u003e contributors&quot;, &quot;detectRetina&quot;: false, &quot;maxNativeZoom&quot;: 19, &quot;maxZoom&quot;: 19, &quot;minZoom&quot;: 0, &quot;noWrap&quot;: false, &quot;opacity&quot;: 1, &quot;subdomains&quot;: &quot;abc&quot;, &quot;tms&quot;: 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+
" &quot;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&quot;,\n",
423+
" {&quot;attribution&quot;: &quot;VEDA&quot;, &quot;detectRetina&quot;: false, &quot;maxZoom&quot;: 18, &quot;minZoom&quot;: 0, &quot;noWrap&quot;: false, &quot;opacity&quot;: 0.8, &quot;subdomains&quot;: &quot;abc&quot;, &quot;tms&quot;: 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+
" &quot;map_182773b58f4c85e85d56761b3fdd307b&quot;,\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+
" &quot;https://tile.openstreetmap.org/{z}/{x}/{y}.png&quot;,\n",
447+
" {&quot;attribution&quot;: &quot;\\u0026copy; \\u003ca href=\\&quot;https://www.openstreetmap.org/copyright\\&quot;\\u003eOpenStreetMap\\u003c/a\\u003e contributors&quot;, &quot;detectRetina&quot;: false, &quot;maxNativeZoom&quot;: 19, &quot;maxZoom&quot;: 19, &quot;minZoom&quot;: 0, &quot;noWrap&quot;: false, &quot;opacity&quot;: 1, &quot;subdomains&quot;: &quot;abc&quot;, &quot;tms&quot;: 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+
" &quot;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&quot;,\n",
456+
" {&quot;attribution&quot;: &quot;VEDA&quot;, &quot;detectRetina&quot;: false, &quot;maxZoom&quot;: 18, &quot;minZoom&quot;: 0, &quot;noWrap&quot;: false, &quot;opacity&quot;: 0.8, &quot;subdomains&quot;: &quot;abc&quot;, &quot;tms&quot;: 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+
"&lt;/script&gt;\n",
467+
"&lt;/html&gt;\" 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+
],
223478
"source": [
224479
"# We'll import folium to map and folium.plugins to allow mapping side-by-side\n",
225480
"import folium\n",

0 commit comments

Comments
 (0)