The default stac-fastapi-pgstac application comes will all extensions enabled (except transaction). Users can use ENABLED_EXTENSIONS environment variable to limit the supported extensions.
Available values for ENABLED_EXTENSIONS:
querysortfieldsfilterfree_text(only for collection-search)pagination(see Pagination details)collection_search
Example: ENABLED_EXTENSIONS="pagination,sort"
Since 6.0.0, the transaction extension is not enabled by default. To add the transaction endpoints, users can set ENABLE_TRANSACTIONS_EXTENSIONS=TRUE/YES/1.
The optional Multi-Tenant Catalogs Extension provides discovery and management endpoints for a multi-tenant STAC architecture. It requires the stac-fastapi-catalogs-extension package to be installed.
For more information about the Multi-Tenant Catalogs specification, see StacLabs/multi-tenant-catalogs.
To enable the catalogs extension, set ENABLE_CATALOGS_EXTENSION=TRUE/YES/1.
When ENABLE_TRANSACTIONS_EXTENSIONS=TRUE, additional write endpoints are available for creating, updating, and deleting catalogs and managing relationships (linking/unlinking catalogs and collections).
PGUSER: postgres usernamePGPASSWORD: postgres passwordPGHOST: hostname for the connectionPGPORT: database portPGDATABASE: database nameDB_MIN_CONN_SIZE: Number of connection the pool will be initialized with. Defaults to1DB_MAX_CONN_SIZEMax number of connections in the pool. Defaults to10DB_MAX_QUERIES: Number of queries after a connection is closed and replaced with a new connection. Defaults to50000DB_MAX_INACTIVE_CONN_LIFETIME: Number of seconds after which inactive connections in the pool will be closed. Defaults to300SEARCH_PATH: Postgres search path. Defaults to"pgstac,public"APPLICATION_NAME: PgSTAC Application name. Defaults to"pgstac"
In version 6.0.0 we've renamed the PG configuration variable to match the official naming convention:
POSTGRES_USER->PGUSERPOSTGRES_PASS->PGPASSWORDPOSTGRES_HOST_READER->PGHOSTPOSTGRES_HOST_WRITER->PGHOST*POSTGRES_PORT->PGPORTPOSTGRES_DBNAME->PGDATABASE
* Since version 6.0, users cannot set a different host for writer and reader database but will need to customize the application and pass a specific stac_fastapi.pgstac.config.PostgresSettings instance to the connect_to_db function.
ENABLE_RESPONSE_MODELS: use pydantic models to validate endpoint responses. Defaults toFalseENABLE_DIRECT_RESPONSE: by-pass the default FastAPI serialization by wrapping the endpoint responses intostarlette.Responseclasses. Defaults toFalse
The limit query parameter (or its default) will trigger pagination of Collection or Items depending on API request context when more entries exist than requested.
Each following page will then be accessible from the corresponding next link in the response containing the appropriate pagination token or offset.
This PgSTAC backend only implements token-based pagination for Items
and offset-based pagination for Collections.
Therefore, your stac-fastapi pagination extension configuration
MUST apply the corresponding implementations adequately when using this backend.
Any other variant will cause search to report incorrect next links and will not yield expected Collections or Items responses.
See stac-fastapi-pgstac/stac_fastapi/pgstac/app.py
for a concrete example of valid configuration.
STAC_FASTAPI_VERSION(string) is the version number of your API instance (this is not the STAC version)STAC FASTAPI_TITLE(string) should be a self-explanatory title for your APISTAC FASTAPI_DESCRIPTION(string) should be a good description for your API. It can contain CommonMarkSTAC_FASTAPI_LANDING_ID(string) is a unique identifier for your Landing pageROOT_PATH: set application root-path (when using proxy)CORS_ORIGINS: A list of origins that should be permitted to make cross-origin requests. Defaults to*CORS_ORIGIN_REGEX: A regex string to match against origins that should be permitted to make cross-origin requests. eg. 'https://.*.example.org'.CORS_METHODS: A list of HTTP methods that should be allowed for cross-origin requests. Defaults to"GET,POST,OPTIONS"CORS_CREDENTIALS: Set totrueto enable credentials via CORS requests. Note that you'll need to setCORS_ORIGINSto something other than*, because credentials are disallowed for wildcard CORS origins.CORS_HEADERS: IfCORS_CREDENTIALSare true and you're using anAuthorizationheader, set this toContent-Type,Authorization. Alternatively, you can allow all headers by setting this to*.USE_API_HYDRATE: perform hydration of stac items within stac-fastapiINVALID_ID_CHARS: list of characters that are not allowed in item or collection ids (used in Transaction endpoints)PREFIX_PATH: An optional path prefix for the underlying FastAPI router.