Skip to content

query

stac_fastapi.extensions.core.query.query

Query extension.

QueryConformanceClasses

Bases: str, Enum

Conformance classes for the Query extension.

See stac-api-extensions/query

Source code in stac_fastapi/extensions/core/query/query.py
14
15
16
17
18
19
20
21
22
class QueryConformanceClasses(str, Enum):
    """Conformance classes for the Query extension.

    See https://github.com/stac-api-extensions/query
    """

    SEARCH = "https://api.stacspec.org/v1.0.0/item-search#query"
    ITEMS = "https://api.stacspec.org/v1.0.0/ogcapi-features#query"
    COLLECTIONS = "https://api.stacspec.org/v1.0.0-rc.1/collection-search#query"

QueryExtension

Bases: ApiExtension

Query Extension.

The Query extension adds an additional query parameter to /search requests which allows the caller to perform queries against item metadata (ex. find all images with cloud cover less than 15%). stac-api-extensions/query

Source code in stac_fastapi/extensions/core/query/query.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@attr.s
class QueryExtension(ApiExtension):
    """Query Extension.

    The Query extension adds an additional `query` parameter to `/search` requests which
    allows the caller to perform queries against item metadata (ex. find all images with
    cloud cover less than 15%).
    https://github.com/stac-api-extensions/query
    """

    GET = QueryExtensionGetRequest
    POST = QueryExtensionPostRequest

    conformance_classes: List[str] = attr.ib(
        factory=lambda: [
            QueryConformanceClasses.SEARCH,
        ]
    )
    schema_href: Optional[str] = attr.ib(default=None)

    def register(self, app: FastAPI) -> None:
        """Register the extension with a FastAPI application.

        Args:
            app: target FastAPI application.

        Returns:
            None
        """
        pass

register

register(app: FastAPI) -> None

Register the extension with a FastAPI application.

Parameters:

  • app (FastAPI) –

    target FastAPI application.

Returns:

  • None

    None

Source code in stac_fastapi/extensions/core/query/query.py
45
46
47
48
49
50
51
52
53
54
def register(self, app: FastAPI) -> None:
    """Register the extension with a FastAPI application.

    Args:
        app: target FastAPI application.

    Returns:
        None
    """
    pass