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

Create attributes in rast to store metadata #1304

Closed
fchianucci opened this issue Oct 6, 2023 · 6 comments
Closed

Create attributes in rast to store metadata #1304

fchianucci opened this issue Oct 6, 2023 · 6 comments

Comments

@fchianucci
Copy link

I already noticed here https://stackoverflow.com/questions/71367060/write-rasterstack-and-preserve-metadata-in-r that terra::rast() can store names() and time() attributes, but what about storing additional metadata? Something likes the @DaTa@attributes in raster::raster()

@rhijmans
Copy link
Member

rhijmans commented Oct 9, 2023

It would be possible to allow storing arbitrary metadata. But I am not sure what the value of that would be. Do you have a compelling use-case?

@fchianucci
Copy link
Author

fchianucci commented Oct 9, 2023 via email

@rhijmans
Copy link
Member

rhijmans commented Oct 10, 2023

Thanks. Please have a look at tags<- to set arbitrary metadata and tags to get the metadata.

A next step could be to also write and read these tags when using file formats that support arbitrary tags (GeoTiff, not sure if there are others).

rhijmans added a commit that referenced this issue Oct 10, 2023
@rhijmans
Copy link
Member

The tags are now written to file (and read again) when using GeoTiff.

@fchianucci
Copy link
Author

fchianucci commented Oct 10, 2023 via email

@kadyb
Copy link
Contributor

kadyb commented Nov 14, 2023

If anyone is looking for this function, tags() has been renamed to metags().

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

No branches or pull requests

3 participants