Giter Club home page Giter Club logo

Comments (3)

geospatial-jeff avatar geospatial-jeff commented on August 23, 2024 4

When we switched to namespace packages the TilesClient (the actual implementation of BaseTilesClient) was dropped. This is fixed in #118, once merged you should be able to enable the tiles extension as follows.

from stac_fastapi.api.app import StacApi
from stac_fastapi.extensions.third_party.tiles import TilesClient, TilesExtension
from stac_fastapi.sqlalchemy.config import SqlalchemySettings
from stac_fastapi.sqlalchemy.core import CoreCrudClient
from stac_fastapi.sqlalchemy.session import Session

settings = SqlalchemySettings()
session = Session.create_from_settings(settings)
db_client = CoreCrudClient(session=session)
api = StacApi(
    settings=settings,
    extensions=[
        TilesExtension(TilesClient(db_client)),
    ],
    client=db_client,
)
app = api.app

Really the only change from your code is we are passing the TilesClient as a parameter to TilesExtension. Because the tiles client also requires the database client, its worth pulling that out to global scope so you can re-use it. Once this is set up, when I navigate to one of the tiles URLs I see the titiler viewer as expected:

image

from stac-fastapi.

geospatial-jeff avatar geospatial-jeff commented on August 23, 2024

@csaybar thanks for the issue! It wouldn't surprise me if the switch to submodules broke the titiler integration, as there aren't any test cases for this particular feature. I'll give it a try myself to see whats up!

from stac-fastapi.

csaybar avatar csaybar commented on August 23, 2024

Thank you @geospatial-jeff it works like a charm!

from stac-fastapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.