Skip to content

core

stac_fastapi.pgstac.core

Item crud client.

CoreCrudClient

Bases: AsyncBaseCoreClient

Client for core endpoints defined by stac.

all_collections async

all_collections(
    request: Request,
    bbox: Optional[BBox] = None,
    datetime: Optional[str] = None,
    limit: Optional[int] = None,
    offset: Optional[int] = None,
    query: Optional[str] = None,
    fields: Optional[List[str]] = None,
    sortby: Optional[str] = None,
    filter_expr: Optional[str] = None,
    filter_lang: Optional[str] = None,
    q: Optional[List[str]] = None,
    **kwargs
) -> Collections

Cross catalog search (GET).

Called with GET /collections.

Returns:

  • Collections

    Collections which match the search criteria, returns all

  • Collections

    collections by default.

get_collection async

get_collection(collection_id: str, request: Request, **kwargs) -> Collection

Get collection by id.

Called with GET /collections/{collection_id}.

Parameters:

  • collection_id (str) –

    ID of the collection.

Returns:

get_item async

get_item(item_id: str, collection_id: str, request: Request, **kwargs) -> Item

Get item by id.

Called with GET /collections/{collection_id}/items/{item_id}.

Parameters:

  • item_id (str) –

    ID of the item.

  • collection_id (str) –

    ID of the collection the item is in.

Returns:

get_search(
    request: Request,
    collections: Optional[List[str]] = None,
    ids: Optional[List[str]] = None,
    bbox: Optional[BBox] = None,
    intersects: Optional[str] = None,
    datetime: Optional[str] = None,
    limit: Optional[int] = None,
    query: Optional[str] = None,
    fields: Optional[List[str]] = None,
    sortby: Optional[str] = None,
    filter_expr: Optional[str] = None,
    filter_lang: Optional[str] = None,
    token: Optional[str] = None,
    **kwargs
) -> ItemCollection

Cross catalog search (GET).

Called with GET /search.

Returns:

  • ItemCollection

    ItemCollection containing items which match the search criteria.

item_collection async

item_collection(
    collection_id: str,
    request: Request,
    bbox: Optional[BBox] = None,
    datetime: Optional[str] = None,
    limit: Optional[int] = None,
    query: Optional[str] = None,
    fields: Optional[List[str]] = None,
    sortby: Optional[str] = None,
    filter_expr: Optional[str] = None,
    filter_lang: Optional[str] = None,
    token: Optional[str] = None,
    **kwargs
) -> ItemCollection

Get all items from a specific collection.

Called with GET /collections/{collection_id}/items

Parameters:

  • collection_id (str) –

    id of the collection.

  • limit (Optional[int], default: None ) –

    number of items to return.

  • token (Optional[str], default: None ) –

    pagination token.

Returns:

post_search(search_request: PgstacSearch, request: Request, **kwargs) -> ItemCollection

Cross catalog search (POST).

Called with POST /search.

Parameters:

  • search_request (PgstacSearch) –

    search request parameters.

Returns:

  • ItemCollection

    ItemCollection containing items which match the search criteria.