|
115 | 115 | " 'type': 'application/json',\n",
|
116 | 116 | " 'href': 'https://staging-stac.delta-backend.com/collections/no2-monthly'}],\n",
|
117 | 117 | " 'title': 'NO₂',\n",
|
| 118 | + " 'assets': None,\n", |
118 | 119 | " 'extent': {'spatial': {'bbox': [[-180, -90, 180, 90]]},\n",
|
119 |
| - " 'temporal': {'interval': [['2015-12-31 17:00:00-07',\n", |
120 |
| - " '2022-04-30 18:00:00-06']]}},\n", |
| 120 | + " 'temporal': {'interval': [['2016-01-01 00:00:00+00',\n", |
| 121 | + " '2023-09-30 00:00:00+00']]}},\n", |
121 | 122 | " 'license': 'MIT',\n",
|
122 |
| - " 'summaries': {'datetime': ['2016-01-01T00:00:00Z', '2022-05-01T00:00:00Z'],\n", |
123 |
| - " 'cog_default': {'max': 50064805976866816, 'min': -6618294421291008}},\n", |
| 123 | + " 'keywords': None,\n", |
| 124 | + " 'providers': None,\n", |
| 125 | + " 'summaries': {'datetime': ['2016-01-01T00:00:00Z', '2023-09-30T00:00:00Z']},\n", |
124 | 126 | " '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",
|
125 | 127 | " 'item_assets': {'cog_default': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized',\n",
|
126 | 128 | " 'roles': ['data', 'layer'],\n",
|
127 | 129 | " 'title': 'Default COG Layer',\n",
|
128 | 130 | " 'description': 'Cloud optimized default layer to display on map'}},\n",
|
129 | 131 | " 'stac_version': '1.0.0',\n",
|
130 |
| - " 'stac_extensions': ['https://stac-extensions.github.io/item-assets/v1.0.0/schema.json'],\n", |
| 132 | + " 'stac_extensions': None,\n", |
131 | 133 | " 'dashboard:is_periodic': True,\n",
|
132 | 134 | " 'dashboard:time_density': 'month'}"
|
133 | 135 | ]
|
|
142 | 144 | "collection"
|
143 | 145 | ]
|
144 | 146 | },
|
145 |
| - { |
146 |
| - "cell_type": "code", |
147 |
| - "execution_count": 4, |
148 |
| - "id": "7bc42fff", |
149 |
| - "metadata": {}, |
150 |
| - "outputs": [ |
151 |
| - { |
152 |
| - "data": { |
153 |
| - "text/plain": [ |
154 |
| - "{'max': 50064805976866816, 'min': -6618294421291008}" |
155 |
| - ] |
156 |
| - }, |
157 |
| - "execution_count": 4, |
158 |
| - "metadata": {}, |
159 |
| - "output_type": "execute_result" |
160 |
| - } |
161 |
| - ], |
162 |
| - "source": [ |
163 |
| - "rescale_values = collection[\"summaries\"][\"cog_default\"]\n", |
164 |
| - "rescale_values" |
165 |
| - ] |
166 |
| - }, |
167 | 147 | {
|
168 | 148 | "cell_type": "markdown",
|
169 | 149 | "id": "aea3352d-6a38-41c7-9dc9-f2c010b3a85b",
|
|
176 | 156 | },
|
177 | 157 | {
|
178 | 158 | "cell_type": "code",
|
179 |
| - "execution_count": 5, |
| 159 | + "execution_count": 6, |
180 | 160 | "id": "b5eb7467",
|
181 | 161 | "metadata": {},
|
182 | 162 | "outputs": [
|
|
186 | 166 | "1"
|
187 | 167 | ]
|
188 | 168 | },
|
189 |
| - "execution_count": 5, |
| 169 | + "execution_count": 6, |
190 | 170 | "metadata": {},
|
191 | 171 | "output_type": "execute_result"
|
192 | 172 | }
|
|
214 | 194 | },
|
215 | 195 | {
|
216 | 196 | "cell_type": "code",
|
217 |
| - "execution_count": 6, |
| 197 | + "execution_count": 7, |
218 | 198 | "id": "79a63492-b9be-4278-85f8-5464fcd9d142",
|
219 | 199 | "metadata": {
|
220 | 200 | "tags": []
|
|
290 | 270 | " 'https://stac-extensions.github.io/raster/v1.1.0/schema.json']}"
|
291 | 271 | ]
|
292 | 272 | },
|
293 |
| - "execution_count": 6, |
| 273 | + "execution_count": 7, |
294 | 274 | "metadata": {},
|
295 | 275 | "output_type": "execute_result"
|
296 | 276 | }
|
|
300 | 280 | "item"
|
301 | 281 | ]
|
302 | 282 | },
|
| 283 | + { |
| 284 | + "cell_type": "code", |
| 285 | + "execution_count": 8, |
| 286 | + "id": "7bc42fff", |
| 287 | + "metadata": {}, |
| 288 | + "outputs": [], |
| 289 | + "source": [ |
| 290 | + "item_stats = item['assets']['cog_default']['raster:bands'][0]['statistics']\n", |
| 291 | + "rescale_values = item_stats['minimum'], item_stats['maximum']" |
| 292 | + ] |
| 293 | + }, |
303 | 294 | {
|
304 | 295 | "cell_type": "markdown",
|
305 | 296 | "id": "c9b60ad7-ed96-42b2-9263-f7ddaa6ea7fe",
|
|
312 | 303 | },
|
313 | 304 | {
|
314 | 305 | "cell_type": "code",
|
315 |
| - "execution_count": 7, |
| 306 | + "execution_count": 10, |
316 | 307 | "id": "71acb916",
|
317 | 308 | "metadata": {},
|
318 | 309 | "outputs": [
|
|
322 | 313 | "{'tilejson': '2.2.0',\n",
|
323 | 314 | " 'version': '1.0.0',\n",
|
324 | 315 | " 'scheme': 'xyz',\n",
|
325 |
| - " 'tiles': ['https://staging-raster.delta-backend.com/stac/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=no2-monthly&item=OMI_trno2_0.10x0.10_202101_Col3_V4.nc&assets=cog_default&color_formula=gamma+r+1.05&colormap_name=rdbu_r&rescale=-6618294421291008%2C50064805976866816'],\n", |
| 316 | + " 'tiles': ['https://staging-raster.delta-backend.com/stac/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=no2-monthly&item=OMI_trno2_0.10x0.10_202101_Col3_V4.nc&assets=cog_default&color_formula=gamma+r+1.05&colormap_name=rdbu_r&rescale=-4107596126486528.0%2C35781585143857150'],\n", |
326 | 317 | " 'minzoom': 0,\n",
|
327 | 318 | " 'maxzoom': 24,\n",
|
328 | 319 | " 'bounds': [-180.0, -90.0, 180.0, 90.0],\n",
|
329 | 320 | " 'center': [0.0, 0.0, 0]}"
|
330 | 321 | ]
|
331 | 322 | },
|
332 |
| - "execution_count": 7, |
| 323 | + "execution_count": 10, |
333 | 324 | "metadata": {},
|
334 | 325 | "output_type": "execute_result"
|
335 | 326 | }
|
|
339 | 330 | " f\"{RASTER_API_URL}/stac/tilejson.json?collection={item['collection']}&item={item['id']}\"\n",
|
340 | 331 | " \"&assets=cog_default\"\n",
|
341 | 332 | " \"&color_formula=gamma+r+1.05&colormap_name=rdbu_r\"\n",
|
342 |
| - " f\"&rescale={rescale_values['min']},{rescale_values['max']}\",\n", |
| 333 | + " f\"&rescale={rescale_values[0]},{rescale_values[1]}\",\n", |
343 | 334 | ").json()\n",
|
344 | 335 | "tiles"
|
345 | 336 | ]
|
|
354 | 345 | },
|
355 | 346 | {
|
356 | 347 | "cell_type": "code",
|
357 |
| - "execution_count": 8, |
| 348 | + "execution_count": 11, |
358 | 349 | "id": "b4792eed",
|
359 | 350 | "metadata": {},
|
360 | 351 | "outputs": [
|
361 | 352 | {
|
362 | 353 | "data": {
|
363 | 354 | "text/html": [
|
364 | 355 | "<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",
|
365 |
| - "<head> \n", |
| 356 | + "<html>\n", |
| 357 | + "<head>\n", |
| 358 | + " \n", |
366 | 359 | " <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n",
|
367 | 360 | " \n",
|
368 | 361 | " <script>\n",
|
|
372 | 365 | " \n",
|
373 | 366 | " <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n",
|
374 | 367 | " <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n",
|
375 |
| - " <script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>\n", |
376 |
| - " <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", |
377 |
| - " <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>\n", |
| 368 | + " <script src="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.js"></script>\n", |
| 369 | + " <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>\n", |
| 370 | + " <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"></script>\n", |
378 | 371 | " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n",
|
379 |
| - " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>\n", |
380 |
| - " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", |
381 |
| - " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", |
382 |
| - " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>\n", |
| 372 | + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.css"/>\n", |
| 373 | + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css"/>\n", |
| 374 | + " <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"/>\n", |
| 375 | + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css"/>\n", |
383 | 376 | " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n",
|
384 | 377 | " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n",
|
385 | 378 | " \n",
|
386 | 379 | " <meta name="viewport" content="width=device-width,\n",
|
387 | 380 | " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n",
|
388 | 381 | " <style>\n",
|
389 |
| - " #map_53c3ccf28112c91094ab0e61813af94b {\n", |
| 382 | + " #map_b760f5d56c6e116deffd4c09b180e7c2 {\n", |
390 | 383 | " position: relative;\n",
|
391 | 384 | " width: 100.0%;\n",
|
392 | 385 | " height: 100.0%;\n",
|
393 | 386 | " left: 0.0%;\n",
|
394 | 387 | " top: 0.0%;\n",
|
395 | 388 | " }\n",
|
| 389 | + " .leaflet-container { font-size: 1rem; }\n", |
396 | 390 | " </style>\n",
|
397 | 391 | " \n",
|
398 | 392 | "</head>\n",
|
399 |
| - "<body> \n", |
| 393 | + "<body>\n", |
400 | 394 | " \n",
|
401 |
| - " <div class="folium-map" id="map_53c3ccf28112c91094ab0e61813af94b" ></div>\n", |
| 395 | + " \n", |
| 396 | + " <div class="folium-map" id="map_b760f5d56c6e116deffd4c09b180e7c2" ></div>\n", |
402 | 397 | " \n",
|
403 | 398 | "</body>\n",
|
404 |
| - "<script> \n", |
| 399 | + "<script>\n", |
| 400 | + " \n", |
405 | 401 | " \n",
|
406 |
| - " var map_53c3ccf28112c91094ab0e61813af94b = L.map(\n", |
407 |
| - " "map_53c3ccf28112c91094ab0e61813af94b",\n", |
| 402 | + " var map_b760f5d56c6e116deffd4c09b180e7c2 = L.map(\n", |
| 403 | + " "map_b760f5d56c6e116deffd4c09b180e7c2",\n", |
408 | 404 | " {\n",
|
409 |
| - " center: [0, 0],\n", |
| 405 | + " center: [0.0, 0.0],\n", |
410 | 406 | " crs: L.CRS.EPSG3857,\n",
|
411 | 407 | " zoom: 1,\n",
|
412 | 408 | " zoomControl: true,\n",
|
|
418 | 414 | "\n",
|
419 | 415 | " \n",
|
420 | 416 | " \n",
|
421 |
| - " var tile_layer_b857ce32e1cc437e1998c6d0926b2f21 = L.tileLayer(\n", |
422 |
| - " "https://staging-raster.delta-backend.com/stac/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=no2-monthly\\u0026item=OMI_trno2_0.10x0.10_202101_Col3_V4.nc\\u0026assets=cog_default\\u0026color_formula=gamma+r+1.05\\u0026colormap_name=rdbu_r\\u0026rescale=-6618294421291008%2C50064805976866816",\n", |
| 417 | + " var tile_layer_8bcaf12e8a9ebcbfd6f653010cb98f18 = L.tileLayer(\n", |
| 418 | + " "https://staging-raster.delta-backend.com/stac/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=no2-monthly\\u0026item=OMI_trno2_0.10x0.10_202101_Col3_V4.nc\\u0026assets=cog_default\\u0026color_formula=gamma+r+1.05\\u0026colormap_name=rdbu_r\\u0026rescale=-4107596126486528.0%2C35781585143857150",\n", |
423 | 419 | " {"attribution": "VEDA", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n",
|
424 |
| - " ).addTo(map_53c3ccf28112c91094ab0e61813af94b);\n", |
| 420 | + " );\n", |
| 421 | + " \n", |
| 422 | + " \n", |
| 423 | + " tile_layer_8bcaf12e8a9ebcbfd6f653010cb98f18.addTo(map_b760f5d56c6e116deffd4c09b180e7c2);\n", |
425 | 424 | " \n",
|
426 |
| - "</script>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" |
| 425 | + "</script>\n", |
| 426 | + "</html>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" |
427 | 427 | ],
|
428 | 428 | "text/plain": [
|
429 |
| - "<folium.folium.Map at 0x7f63906c6af0>" |
| 429 | + "<folium.folium.Map at 0x7fcac62cb650>" |
430 | 430 | ]
|
431 | 431 | },
|
432 |
| - "execution_count": 8, |
| 432 | + "execution_count": 11, |
433 | 433 | "metadata": {},
|
434 | 434 | "output_type": "execute_result"
|
435 | 435 | }
|
|
444 | 444 | ],
|
445 | 445 | "metadata": {
|
446 | 446 | "kernelspec": {
|
447 |
| - "display_name": "Python [conda env:notebook] *", |
| 447 | + "display_name": "Python 3 (ipykernel)", |
448 | 448 | "language": "python",
|
449 |
| - "name": "conda-env-notebook-py" |
| 449 | + "name": "python3" |
450 | 450 | },
|
451 | 451 | "language_info": {
|
452 | 452 | "codemirror_mode": {
|
|
458 | 458 | "name": "python",
|
459 | 459 | "nbconvert_exporter": "python",
|
460 | 460 | "pygments_lexer": "ipython3",
|
461 |
| - "version": "3.9.13" |
| 461 | + "version": "3.11.7" |
462 | 462 | }
|
463 | 463 | },
|
464 | 464 | "nbformat": 4,
|
|
0 commit comments