|
459 | 459 | cell1.innerHTML = "Asset"; |
460 | 460 | cell2.innerHTML = "Type" |
461 | 461 |
|
462 | | - for (let asset_name in collection_metadata.item_assets) { |
| 462 | + const rio_types = [ |
| 463 | + "image/tiff; application=geotiff", |
| 464 | + "image/tiff; application=geotiff; profile=cloud-optimized", |
| 465 | + "image/tiff; profile=cloud-optimized; application=geotiff", |
| 466 | + "image/vnd.stac.geotiff; cloud-optimized=true", |
| 467 | + "image/tiff", |
| 468 | + "image/x.geotiff", |
| 469 | + "image/jp2", |
| 470 | + "application/x-hdf5", |
| 471 | + "application/x-hdf", |
| 472 | + ] |
| 473 | + const assets = Object.keys(collection_metadata.item_assets).filter(key => rio_types.includes(collection_metadata.item_assets[key].type)) |
| 474 | + for (var i = 0; i < assets.length; i++) { |
463 | 475 | var row = tbl.insertRow(-1); |
464 | 476 | var cell1 = row.insertCell(0); |
465 | 477 | var cell2 = row.insertCell(1); |
466 | | - cell1.innerHTML = asset_name; |
467 | | - cell2.innerHTML = collection_metadata.item_assets[asset_name].type; |
| 478 | + cell1.innerHTML = assets[i]; |
| 479 | + cell2.innerHTML = collection_metadata.item_assets[assets[i]].type; |
468 | 480 | } |
469 | 481 | collection_meta.appendChild(tbl) |
470 | 482 | } |
|
496 | 508 | body.metadata.bounds = collection_metadata.extent.spatial.bbox[0]; |
497 | 509 | } |
498 | 510 |
|
| 511 | + if (collection_metadata && collection_metadata.item_assets) { |
| 512 | + // if item_assets is found in the collection we set the mosaic `assets` in the metadata |
| 513 | + // collection_metadata.item_assets |
| 514 | + |
| 515 | + const rio_types = [ |
| 516 | + "image/tiff; application=geotiff", |
| 517 | + "image/tiff; application=geotiff; profile=cloud-optimized", |
| 518 | + "image/tiff; profile=cloud-optimized; application=geotiff", |
| 519 | + "image/vnd.stac.geotiff; cloud-optimized=true", |
| 520 | + "image/tiff", |
| 521 | + "image/x.geotiff", |
| 522 | + "image/jp2", |
| 523 | + "application/x-hdf5", |
| 524 | + "application/x-hdf", |
| 525 | + ] |
| 526 | + body.metadata.assets = Object.keys(collection_metadata.item_assets).filter(key => rio_types.includes(collection_metadata.item_assets[key].type)) |
| 527 | + } |
| 528 | + |
499 | 529 | // date filters |
500 | 530 | const startdate = document.getElementById('start-date').value |
501 | 531 | const enddate = document.getElementById('end-date').value |
|
0 commit comments