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

Baseline compatability with STAC? #117

Open
robmarkcole opened this issue Dec 14, 2018 · 1 comment
Open

Baseline compatability with STAC? #117

robmarkcole opened this issue Dec 14, 2018 · 1 comment
Labels
question Further information is requested

Comments

@robmarkcole
Copy link

I haven't spent much with with terracotta yet but its great that it is agnositc about the file structure of imagery. However you might also want to have a baseline for documenting etc, so perhaps could consider adhering to the STAC spec? https://github.com/radiantearth/stac-spec

@dionhaefner
Copy link
Collaborator

Very interesting.

Part of the point of Terracotta is that we do not want to include all metadata that you could conceivably use to describe a raster file to build a catalogue, but instead hand-pick only the relevant keys that make sense for your given deployment. We made this choice because of two main reasons:

  1. To reduce cognitive load on users and frontend devs (who might not be familiar with the intricacies of geodata).
  2. Because I personally believe that every attempt of a spec is doomed, because the geodata universe is so rich and heterogeneous.

I didn't know about the STAC spec, and I do think it looks reasonably small and general to be useful. However, I don't see how it could fit with the current Terracotta data model.

That being said, in Terracotta you can always roll your own conventions:

import terracotta as tc

driver = tc.get_driver('mydb.sqlite')

raster_file = 'myraster.tif'
raster_keys = ['S2', '20180101', 'B04']
stac_metadata = {
    'asset': ...,
    'geometry': ...,
    'link': ...,
    # other STAC data
}

tc_metadata = driver.compute_metadata(raster_file, extra_metadata=stac_metadata)
driver.insert(keys, raster_file, metadata=tc_metadata)

Then, you can retrieve the extra metadata verbatim from the frontend:

$ curl localhost:5000/metadata/S2/20180101/B04
{
  ...
  metadata: {
    asset: ...,
    geometry: ...,
    link: ...
  }
}

Hope that clears it up a bit.

@dionhaefner dionhaefner added the question Further information is requested label Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants