radiantearth / stac-browser

A full-fledged UI in Vue for browsing and searching static STAC catalogs and STAC APIs
https://radiantearth.github.io/stac-browser
ISC License
273 stars 136 forks source link

TiTiler Endpoint Integration #283

Open BnJam opened 1 year ago

BnJam commented 1 year ago

Issue item from conversation with @m-mohr (Tweet 🧵)

Integrating TiTiler /stac endpoints into the STAC Browser could offer accessible analytical exploration.

One example would be using the /statistics?expression=... to retrieve band math to be visualized in the tiler. Other operations can be streamed through TiTiler endpoints as a preprocessing engine.

DanielJDufour commented 1 year ago

@BnJam , could you expand on the use case? I'd love to hear more!

I originally tried to add TiTiler support to stac-layer (used by stac-browser for visualization) but found most of the basic use cases covered by treating it as a generic tiling endpoint (vs. leveraging the specifics of TiTiler). I'm sure there are advanced use cases that would more fully leverage the advanced capabilities of TiTiler, I just need to understand what they are better and would need help creating test cases for them.

fwiw, I would recommend checking out the files listed here: https://github.com/stac-utils/stac-layer/pull/55/files. It leverages dynamic-client, which creates a simple JavaScript client for TiTiler based on the OpenAPI Definition. I think getting statistics would be as easy as

const client = new DynamicClient({ url });

await client.init();

client.stac.statistics.get({ url, expression: "Asset1_b1/Asset2_b1" })

Open to your thoughts!

BnJam commented 1 year ago

I hadn't heard of stac-layer yet! I will have to dig into that more 🙂

As you may have seen, I also started a Discussion on DevelopmentSeed's TiTilers (well, a Bug at first, oops):

This discussion opens an avenue for collaboration on a STAC Browser dedicated endpoint that could be optimised as a preprocessing engine when retrieving data.


could you expand on the use case? I'd love to hear more!

Certainly!

The Use Case I was thinking about involves a more interactive tiling visualization pane that is user friendly to reduce the complexity needed to non-developer users to navigate and use the STAC Browser. This would be most apparent in the Search pane where Users could use the tiling service to inspect the data, however having a sidebar option to select indice operations to visualize on the tiled view (via drop down? Multi-box selection? with map layers) could help data investigation. An addition to that is using the endpoint /stac/point/{lon},{lat} to create a temporal value graph (eg with NDVI to see vegetation health). This would be useful for selecting appropriate spatial and temporal AOI's.

The STAC Browser could make use of a dedicated TiTiler endpoint for services that leverage visualization data. TiTiler would enable functionality into the render so a client, customer, or colleague can visually explore the Catalog/Collection and manipulate option values to drill into the data better with accessible metadata on indice or asset statistics.

Adding TiTiler integration, for a search/query operation, could be able to better filter results based on band operations, statistics, and thresholds.

These are some of my ideas on how TiTiler could be integrated. Is this realistic for STAC Browsers scope?

I am also eager to involve a wider audience - perhaps a more followed person can Tweet about this for feedback from the geospatial community?

m-mohr commented 1 year ago

This is all very interesting and I'd love to see this in STAC Browser.

There are two concerns though:

  1. Right now it's not clear whether Leaflet or OpenLayers will power the maps in STAC Browser (see #254). Implementing such a functionality should ideally be implemented after choosing to support a library long-term. Right now it's Leaflet, but there's a slight tendency to migrate to OpenLayers after 3.0.0 (as WebGL seems to be much faster).
  2. This needs quite a bit of dev time so funding is also important, of course. Generally happy to review PRs though or open for funded work.