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
276 stars 138 forks source link

Enhancement for search function list of results #255

Closed chiarch84 closed 1 year ago

chiarch84 commented 1 year ago

Since at the moment the collection-search APIs are at embrional stage and it is not easy to understand how to integrate it in the search window I think it could be a great improvement to have some more functionalities on the list of shown results.

One useful possibility could be to have results grouped by collection.

In the following search for example, I have all items in our catalog that have data from Spain, but of course I have hundreds of them since we store Sentinel data and also other collections of completely different types.

image

If I could at list see which collections were involved I could go directly to the ones I'm interested in. Even better if I could also write some text like DEM or so to filter the collections titles. Of course it would have to be done only in js and with no API behind since it is not defined yet.

It would be a great improvement since when the user goes to the search he is many times not knowing anything about the catalog. That's why seeing a list of hundreds of items that all seem similar (e.g. Sentinel ones) without having the possibility to get an overview on the collections that group these items, is not really giving him any help.

m-mohr commented 1 year ago

The collection grouping won't work unless the API returns that information specifically. On the first page there could only be S2, on the second page only some of S2 and some of L8 and on the third page MODIS could come up etc. Maybe something for a stac-api-extension.

Also, if you want to search in the collection titles I'd need to retrieve the collection metadata additionally, which may result in a lot of additional requests and then you'd only search the first page of results. I can't know what the additional pages may contain except if I request them all, but that could be thousands of pages which is unfeasible to request for this.

So I'm pretty sorry, but this won't be possible in STAC Browser unless a stac-api-extension makes it available via the APIs. But many search APIs also only know what's in the other pages once requested. Otherwise the server would need to go through all the results upfront to make an aggregation.

If you have other ideas how this could be done on the client-side I'm happy to consider them, but right now I have no idea how this could be feasible.

m-mohr commented 1 year ago

You could also select from the list of collections upfront, but I'm not sure why they don't show up for you. Do you support API Collections (i.e. /collections and have a data link in the landing page)? Do you paginate the collections?

chiarch84 commented 1 year ago

Hmm, you're right, if you don't have the whole list of results in memory you can't do it I guess. I'll try to think if I can come up with a "solution" to do it client side, since I really think that the "search" is the heart of the browser and if the user cannot find what he needs then it is not helping him. In fact many times it is not an experienced user who uses the GUI search, so he doesn't precisely know what he's looking for.

m-mohr commented 1 year ago

I think you need to solve this on the server-side and that would need an API extension. Collection[1] search may help a bit or the aggregate extension[2], but maybe it even needs a dedicated extension.

[1] https://github.com/stac-api-extensions/collection-search [2] https://github.com/stac-api-extensions/aggregation

chiarch84 commented 1 year ago

I need to redeploy to show the list of collections, and that will already be a good improvement, but it is still not enough for the basic user.

In our specific use case we would for example have a researcher trying to find all available data from a certain place. He might know that we have Sentinel data, but he wants to find out if we have some more data that he hadn't thought of .

m-mohr commented 1 year ago

Do you know all collections upfront and could add them to the search results?

chiarch84 commented 1 year ago

Well, I have the full list of collections returned in the /collections API endpoint. Is this what you mean? Or you mean the list of collections concerning that specific query?

m-mohr commented 1 year ago

Yeah, the collection list for a specific search/query. That you'd need to return so that STAC Browser can read it and make a usable UI out of it.

Otherwise, collection search might be what you want to implement and then we could think about a two-step search.

chiarch84 commented 1 year ago

But is the list of collections for a specific query something already previewed by an extension?

Anyhow, it might be that what is needed is the "collection search", since in fact each collection has a spatial extent and so I could query all collections to understand which ones have data from e.g. Spain. And only then I could enter the collection itself and filter its own items more in detail.

m-mohr commented 1 year ago

But is the list of collections for a specific query something already previewed by an extension?

No, that's something you'd need to work on.

Anyhow, it might be that what is needed is the "collection search"

Yes, indeed.

m-mohr commented 1 year ago

@chiarch84 I just found this extension, which might be helpful for you: https://github.com/cedadev/stac-context-collections

chiarch84 commented 1 year ago

Thanks a lot @m-mohr this could be in fact the case. I'll study it a little more to understand if it fits well! Thanks