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

Stac-Browser item view: script block and memory occupation #580

Open
luipir opened this issue Mar 5, 2025 · 2 comments
Open

Stac-Browser item view: script block and memory occupation #580

luipir opened this issue Mar 5, 2025 · 2 comments
Assignees
Milestone

Comments

@luipir
Copy link

luipir commented Mar 5, 2025

Stac-browser in ol-stac seems working correctly when run locally or run in a docker, but we are facing issues when deployed in the first draft of a demo application.
The context is:

  1. run dockerised build of stac-browser from ol-stac branch
  2. the config.js and buildUrlTemplate works correctly until we show collection of 5 items that are cog served correctly via titiler (the reason to use tritiler and buildTilerUrlTemplate is to have a different url for item download from that used to stream it
  3. browser blocks when trying to enter visualizing items, continuously increasing memory occupation and occupying a 100% of a core.

any hint how to give you more info?

here the config.js

module.exports = {
    catalogUrl: "http://<anip>:<aport>/",
    catalogTitle: "Aerofototeca ROMA",
    allowExternalAccess: false, // Must be true if catalogUrl is not given
    allowedDomains: [],
    detectLocaleFromBrowser: true,
    storeLocale: true,
    locale: "en",
    fallbackLocale: "en",
    supportedLocales: [
        "de",
//      "de-CH",
        "es",
        "en",
//      "en-GB",
//      "en-US",
        "fr",
//      "fr-CA",
//      "fr-CH",
        "it",
//      "it-CH",
        "ro",
        "ja",
        "pt",
//      "pt-BR"
    ],
    apiCatalogPriority: null,
    useTileLayerAsFallback: false,
    displayGeoTiffByDefault: false,
    buildTileUrlTemplate: async (
        asset
    ) => {
        let modifiedHref = asset.href.replace("/...apath.../download", "/...apath.../tile");
        return "http://127.0.0.1:8088/cog/tiles/WebMercatorQuad/{z}/{x}/{y}@2x?url=" + encodeURIComponent(modifiedHref);
      },
    stacProxyUrl: null,
    pathPrefix: null,
    historyMode: "history",
    cardViewMode: "cards",
    cardViewSort: "asc",
    showKeywordsInItemCards: true,
    showKeywordsInCatalogCards: true,
    showThumbnailsAsAssets: true,
    redirectLegacyUrls: false,
    itemsPerPage: 12,
    defaultThumbnailSize: [300, 300],
    maxPreviewsOnMap: 50,
    crossOriginMedia: null,
    requestHeaders: {},
    requestQueryParameters: {},
    socialSharing: ['email', 'bsky', 'mastodon', 'x'],
    preprocessSTAC: null,
    authConfig: null
};

@luipir
Copy link
Author

luipir commented Mar 5, 2025

temporarly a demo can be seen her:
https :// geoportale - preprod . comune . roma . it / aerofototeca - web /

@luipir
Copy link
Author

luipir commented Mar 5, 2025

here a suggestion by @m-mohr shared privately:


Hi
I had a quick look and it seems that the issue is not related to ol-stac. In the config you need to add a slash at the end of the URL when your self links also have it in the API responses (which they do), otherwise the internal database seems to run into an endless loop due to the mismatch of URLs. That seems to be a configuration issue in the first place (see docs: https://github.com/radiantearth/stac-browser/blob/main/docs/options.md#catalogurl), but it's also a bug in that sense that the Browser should never lead to blocking the browser.

@m-mohr m-mohr added this to the 3.4.0 milestone Mar 5, 2025
@m-mohr m-mohr self-assigned this Mar 5, 2025
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

2 participants