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

convenient function to get the field raster metadata. #848

Open
lazarusA opened this issue Jan 2, 2025 · 4 comments
Open

convenient function to get the field raster metadata. #848

lazarusA opened this issue Jan 2, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@lazarusA
Copy link
Collaborator

lazarusA commented Jan 2, 2025

Currently, using metadata

metadata(ras_resample)
Metadata{Rasters.GDALsource} of Dict{String, Any} with 4 entries:
  "units"    => ""
  "offset"   => 0.0
  "filepath" => "/vsimem/tmp"
  "scale"    => 1.0

but getting this info seems to take more effort:

├───────────────────────────────────────────────────── raster ┤
  extent: Extent(X = (-180.0, 180.0), Y = (-90.0, 90.0))
  missingval: NaN32
  crs: EPSG:4326
└─────────────────────────────────────────────────────────────┘

namely, ras_sample.missingval, crs(ras_sample) and extent(ras_sample), where all of them output different types, hence a convenient function that outputs a Dict similar to the one from metadata would be nice to have.

@lazarusA lazarusA added the enhancement New feature or request label Jan 2, 2025
@tiemvanderdeure
Copy link
Collaborator

There is also missingval(ras_sample).

I'm not sure about this one. How often would you really need all of these three properties in one object? They don't really have much in common other than that they are shown together.

@lazarusA
Copy link
Collaborator Author

lazarusA commented Jan 3, 2025

ideally, I would like to have only one function to get all metadata information.

@tiemvanderdeure
Copy link
Collaborator

But then what should count as metadata? If I load a Raster lazily, the file path appears in the same box (or at least it should). But this would be a bit weird to include as it doesn't say much about the actual object. On the other hand the sampling (point-based vs intervals) is more closely related to crs/extent, but it doesn't appear in that box. I don't really see a way to design that that fits everyone's needs here.

@lazarusA
Copy link
Collaborator Author

lazarusA commented Jan 3, 2025

sampling (point-based vs intervals)

yes, I also noticed that one, and probably should also be included. Probably, best will to output collect as much as possible and then let users decide what to leave out.

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

2 participants