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

[Proposal] Remove Child links (collections) in Landing page #797

Open
vincentsarago opened this issue Feb 6, 2025 · 1 comment · May be fixed by #798
Open

[Proposal] Remove Child links (collections) in Landing page #797

vincentsarago opened this issue Feb 6, 2025 · 1 comment · May be fixed by #798
Labels
enhancement New feature or request question Further information is requested

Comments

@vincentsarago
Copy link
Member

By default we add all the collections links to the landing page, but when the catalog grows this might become useless or really slow (we have catalogs with > 100 collections).

# Add Collections links
collections = self.all_collections(request=kwargs["request"])
for collection in collections["collections"]:
landing_page["links"].append(
{
"rel": Relations.child.value,
"type": MimeTypes.json.value,
"title": collection.get("title") or collection.get("id"),
"href": urljoin(base_url, f"collections/{collection['id']}"),
}
)

Note: When using pgstac with the collection-search extension enabled, we now return a default of 10 collections (default limit in pgstac) so the landing page of stac-fastapi-pgstac will only return the first 10 collections links

@m-mohr not sure if stac-browser is using the landing page child links or directly the /collections link

@m-mohr
Copy link
Contributor

m-mohr commented Feb 6, 2025

Both, and then deduplicates, so this change is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants