Module stac_fastapi.pgstac.models.links¶
link helpers.
Variables¶
INFERRED_LINK_RELS
Functions¶
filter_links¶
def filter_links(
links: List[Dict]
) -> List[Dict]
Remove inferred links.
merge_params¶
def merge_params(
url: str,
newparams: Dict
) -> str
Merge url parameters.
Classes¶
BaseLinks¶
class BaseLinks(
request: starlette.requests.Request
)
Create inferred links common to collections and items.
Descendants¶
- stac_fastapi.pgstac.models.links.PagingLinks
- stac_fastapi.pgstac.models.links.CollectionLinksBase
Instance variables¶
base_url
Get the base url.
url
Get the current request url.
Methods¶
create_links¶
def create_links(
self
) -> List[Dict[str, Any]]
Return all inferred links.
get_links¶
def get_links(
self,
extra_links: Optional[List[Dict[str, Any]]] = 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_.
link_root¶
def link_root(
self
) -> Dict
Return the catalog root.
link_self¶
def link_self(
self
) -> Dict
Return the self link.
resolve¶
def resolve(
self,
url
)
Resolve url to the current request url.
CollectionLinks¶
class CollectionLinks(
request: starlette.requests.Request,
collection_id: str
)
Create inferred links specific to collections.
Ancestors (in MRO)¶
- stac_fastapi.pgstac.models.links.CollectionLinksBase
- stac_fastapi.pgstac.models.links.BaseLinks
Instance variables¶
base_url
Get the base url.
url
Get the current request url.
Methods¶
collection_link¶
def collection_link(
self,
rel: str = 'collection'
) -> Dict
Create a link to a collection.
create_links¶
def create_links(
self
) -> List[Dict[str, Any]]
Return all inferred links.
get_links¶
def get_links(
self,
extra_links: Optional[List[Dict[str, Any]]] = 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_.
link_items¶
def link_items(
self
) -> Dict
Create the item
link.
link_parent¶
def link_parent(
self
) -> Dict
Create the parent
link.
link_root¶
def link_root(
self
) -> Dict
Return the catalog root.
link_self¶
def link_self(
self
) -> Dict
Return the self link.
resolve¶
def resolve(
self,
url
)
Resolve url to the current request url.
CollectionLinksBase¶
class CollectionLinksBase(
request: starlette.requests.Request,
collection_id: str
)
Create inferred links specific to collections.
Ancestors (in MRO)¶
- stac_fastapi.pgstac.models.links.BaseLinks
Descendants¶
- stac_fastapi.pgstac.models.links.CollectionLinks
- stac_fastapi.pgstac.models.links.ItemCollectionLinks
- stac_fastapi.pgstac.models.links.ItemLinks
Instance variables¶
base_url
Get the base url.
url
Get the current request url.
Methods¶
collection_link¶
def collection_link(
self,
rel: str = 'collection'
) -> Dict
Create a link to a collection.
create_links¶
def create_links(
self
) -> List[Dict[str, Any]]
Return all inferred links.
get_links¶
def get_links(
self,
extra_links: Optional[List[Dict[str, Any]]] = 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_.
link_root¶
def link_root(
self
) -> Dict
Return the catalog root.
link_self¶
def link_self(
self
) -> Dict
Return the self link.
resolve¶
def resolve(
self,
url
)
Resolve url to the current request url.
ItemCollectionLinks¶
class ItemCollectionLinks(
request: starlette.requests.Request,
collection_id: str
)
Create inferred links specific to collections.
Ancestors (in MRO)¶
- stac_fastapi.pgstac.models.links.CollectionLinksBase
- stac_fastapi.pgstac.models.links.BaseLinks
Instance variables¶
base_url
Get the base url.
url
Get the current request url.
Methods¶
collection_link¶
def collection_link(
self,
rel: str = 'collection'
) -> Dict
Create a link to a collection.
create_links¶
def create_links(
self
) -> List[Dict[str, Any]]
Return all inferred links.
get_links¶
def get_links(
self,
extra_links: Optional[List[Dict[str, Any]]] = 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_.
link_collection¶
def link_collection(
self
) -> Dict
Create the collection
link.
link_parent¶
def link_parent(
self
) -> Dict
Create the parent
link.
link_root¶
def link_root(
self
) -> Dict
Return the catalog root.
link_self¶
def link_self(
self
) -> Dict
Return the self link.
resolve¶
def resolve(
self,
url
)
Resolve url to the current request url.
ItemLinks¶
class ItemLinks(
request: starlette.requests.Request,
collection_id: str,
item_id: str
)
Create inferred links specific to items.
Ancestors (in MRO)¶
- stac_fastapi.pgstac.models.links.CollectionLinksBase
- stac_fastapi.pgstac.models.links.BaseLinks
Instance variables¶
base_url
Get the base url.
url
Get the current request url.
Methods¶
collection_link¶
def collection_link(
self,
rel: str = 'collection'
) -> Dict
Create a link to a collection.
create_links¶
def create_links(
self
) -> List[Dict[str, Any]]
Return all inferred links.
get_links¶
def get_links(
self,
extra_links: Optional[List[Dict[str, Any]]] = 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_.
link_collection¶
def link_collection(
self
) -> Dict
Create the collection
link.
link_parent¶
def link_parent(
self
) -> Dict
Create the parent
link.
link_root¶
def link_root(
self
) -> Dict
Return the catalog root.
link_self¶
def link_self(
self
) -> Dict
Create the self link.
resolve¶
def resolve(
self,
url
)
Resolve url to the current request url.
PagingLinks¶
class PagingLinks(
request: starlette.requests.Request,
*,
next: Optional[str] = None,
prev: Optional[str] = None
)
Create links for paging.
Ancestors (in MRO)¶
- stac_fastapi.pgstac.models.links.BaseLinks
Instance variables¶
base_url
Get the base url.
url
Get the current request url.
Methods¶
create_links¶
def create_links(
self
) -> List[Dict[str, Any]]
Return all inferred links.
get_links¶
def get_links(
self,
extra_links: Optional[List[Dict[str, Any]]] = 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_.
link_next¶
def link_next(
self
) -> Optional[Dict[str, Any]]
Create link for next page.
link_prev¶
def link_prev(
self
) -> Optional[Dict[str, Any]]
Create link for previous page.
link_root¶
def link_root(
self
) -> Dict
Return the catalog root.
link_self¶
def link_self(
self
) -> Dict
Return the self link.
resolve¶
def resolve(
self,
url
)
Resolve url to the current request url.