Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconfigure Logic in Asset Class to store filename #48

Open
SethDocherty opened this issue Nov 7, 2024 · 1 comment
Open

Reconfigure Logic in Asset Class to store filename #48

SethDocherty opened this issue Nov 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@SethDocherty
Copy link
Member

getAssetFromItem comments:

After looking at the method(s) in more detail, we're going to have to tweak these methods a little. The idea I had was that we would grab the name of the file which would be a property in Asset class.

for example, json for the asset SAA:

"SAA": {
  "href": "https://landsatlook.usgs.gov/data/collection02/level-1/standard/oli-tirs/2022/017/039/LC09_L1GT_017039_20221029_20221029_02_T2/LC09_L1GT_017039_20221029_20221029_02_T2_SAA.TIF",
  "type": "image/vnd.stac.geotiff; cloud-optimized=true",
  "roles": [
    "sun-azimuth"
  ],
  "title": "Solar Azimuth Angle Band",
  "alternate": {
    "s3": {
      "href": "s3://usgs-landsat/collection02/level-1/standard/oli-tirs/2022/017/039/LC09_L1GT_017039_20221029_20221029_02_T2/LC09_L1GT_017039_20221029_20221029_02_T2_SAA.TIF",
      "storage:platform": "AWS",
      "storage:requester_pays": true
    },
    "IPFS": {
      "href": "ipfs://bafybeicfu3xu6mxfoxr7pd24pmbiq3t4ti7ffjuimg3a4nhekoq3x4wahq"
    },
    "Filecoin": {
      "href": "ipfs://bafybeihhdnvfga74krt55whsyvbq7g2p2uc7c6vv24cszxylt3rckpm6dy",
      "storage:platform": "PiKNiK"
    }
  },
  "description": "Collection 2 Level-1 Solar Azimuth Angle Band"
},

I was hoping to grab the file name from the href property: LC09_L1GT_017039_20221029_20221029_02_T2_SAA.TIF

and for GEDI:

"assets": {
  "opendap": {
    "href": "https://opendap.earthdata.nasa.gov/collections/C2237824918-ORNL_CLOUD/granules/GEDI_L4A_AGB_Density_V2_1.GEDI04_A_2023075201011_O24115_02_T08796_02_003_01_V002.h5",
    "title": "OPeNDAP request URL (GET DATA : OPENDAP DATA)"
  },
  "metadata": {
    "href": "https://cmr.earthdata.nasa.gov/search/concepts/G2764298906-ORNL_CLOUD.xml",
    "type": "application/xml"
  },
  "SHA-256 file": {
    "href": "https://data.ornldaac.earthdata.nasa.gov/public/gedi/GEDI_L4A_AGB_Density_V2_1/data/GEDI04_A_2023075201011_O24115_02_T08796_02_003_01_V002.h5.sha256"
  },
  "gov/protected/gedi/GEDI_L4A_AGB_Density_V2_1/data/GEDI04_A_2023075201011_O24115_02_T08796_02_003_01_V002": {
    "href": "https://data.ornldaac.earthdata.nasa.gov/protected/gedi/GEDI_L4A_AGB_Density_V2_1/data/GEDI04_A_2023075201011_O24115_02_T08796_02_003_01_V002.h5",
    "type": "application/x-hdf5",
    "title": "Download GEDI04_A_2023075201011_O24115_02_T08796_02_003_01_V002.h5",
    "alternate": {
    }
  }
},

Filename from the href: GEDI_L4A_AGB_Density_V2_1/data/GEDI04_A_2023075201011_O24115_02_T08796_02_003_01_V002.h5

When a user does pin the content, we could pass the filename property into the name argument for pin/add. Doing so will be a nice quality of life update when the user runs the method pinned_list(name=True) as it will list out the link name along with the cid

@SethDocherty SethDocherty added the enhancement New feature or request label Nov 7, 2024
@SethDocherty
Copy link
Member Author

This comment is also related to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant