Skip to content

Module stac_fastapi.core.models.links

link helpers.

Variables

INFERRED_LINK_RELS

Functions

merge_params

def merge_params(
    url: str,
    newparams: Dict
) -> str

Merge url parameters.

Classes

class BaseLinks(
    request: starlette.requests.Request
)

Create inferred links common to collections and items.

Descendants

  • stac_fastapi.core.models.links.CollectionLinks
  • stac_fastapi.core.models.links.PagingLinks

Instance variables

base_url

Get the base url.

url

Get the current request url.

Methods

def create_links(
    self
) -> List[Dict[str, Any]]

Return all inferred links.

def get_links(
    self,
    extra_links: Union[List[Dict[str, Any]], NoneType] = None
) -> List[Dict[str, Any]]

Generate all the links.

Get the links object for a stac resource by iterating through available methods on this class that start with link_.

def link_root(
    self
) -> Dict

Return the catalog root.

def link_self(
    self
) -> Dict

Return the self link.

resolve

def resolve(
    self,
    url
)

Resolve url to the current request url.

class CollectionLinks(
    request: starlette.requests.Request,
    collection_id: str,
    extensions: List[str] = NOTHING
)

Create inferred links specific to collections.

Ancestors (in MRO)

  • stac_fastapi.core.models.links.BaseLinks

Instance variables

base_url

Get the base url.

url

Get the current request url.

Methods

def create_links(
    self
) -> List[Dict[str, Any]]

Return all inferred links.

def get_links(
    self,
    extra_links: Union[List[Dict[str, Any]], NoneType] = None
) -> List[Dict[str, Any]]

Generate all the links.

Get the links object for a stac resource by iterating through available methods on this class that start with link_.

def link_items(
    self
) -> Dict[str, Any]

Create the items link.

def link_parent(
    self
) -> Dict[str, Any]

Create the parent link.

def link_queryables(
    self
) -> Dict[str, Any]

Create the queryables link.

def link_root(
    self
) -> Dict

Return the catalog root.

def link_self(
    self
) -> Dict

Return the self link.

resolve

def resolve(
    self,
    url
)

Resolve url to the current request url.

class PagingLinks(
    request: starlette.requests.Request,
    *,
    next: Union[str, NoneType] = None
)

Create links for paging.

Ancestors (in MRO)

  • stac_fastapi.core.models.links.BaseLinks

Instance variables

base_url

Get the base url.

url

Get the current request url.

Methods

def create_links(
    self
) -> List[Dict[str, Any]]

Return all inferred links.

def get_links(
    self,
    extra_links: Union[List[Dict[str, Any]], NoneType] = None
) -> List[Dict[str, Any]]

Generate all the links.

Get the links object for a stac resource by iterating through available methods on this class that start with link_.

def link_next(
    self
) -> Union[Dict[str, Any], NoneType]

Create link for next page.

def link_root(
    self
) -> Dict

Return the catalog root.

def link_self(
    self
) -> Dict

Return the self link.

resolve

def resolve(
    self,
    url
)

Resolve url to the current request url.