diff --git a/stac_fastapi/core/stac_fastapi/core/extensions/filter.py b/stac_fastapi/core/stac_fastapi/core/extensions/filter.py index c6859672..ddeb2600 100644 --- a/stac_fastapi/core/stac_fastapi/core/extensions/filter.py +++ b/stac_fastapi/core/stac_fastapi/core/extensions/filter.py @@ -41,24 +41,6 @@ "description": "Creation Timestamp", "$ref": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/datetime.json#/properties/updated", }, - "cloud_cover": { - "description": "Cloud Cover", - "$ref": "https://stac-extensions.github.io/eo/v1.0.0/schema.json#/definitions/fields/properties/eo:cloud_cover", - }, - "cloud_shadow_percentage": { - "title": "Cloud Shadow Percentage", - "description": "Cloud Shadow Percentage", - "type": "number", - "minimum": 0, - "maximum": 100, - }, - "nodata_pixel_percentage": { - "title": "No Data Pixel Percentage", - "description": "No Data Pixel Percentage", - "type": "number", - "minimum": 0, - "maximum": 100, - }, } """Queryables that are present in all collections.""" diff --git a/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py b/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py index 9d0eb69b..8a9cf428 100644 --- a/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py +++ b/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py @@ -4,6 +4,7 @@ from typing import Any, Dict, Optional, Tuple import attr +from fastapi import Request from stac_fastapi.core.base_database_logic import BaseDatabaseLogic from stac_fastapi.core.extensions.filter import ALL_QUERYABLES, DEFAULT_QUERYABLES @@ -37,9 +38,11 @@ async def get_queryables( Returns: Dict[str, Any]: A dictionary containing the queryables for the given collection. """ + request: Optional[Request] = kwargs.get("request") + url_str: str = str(request.url) if request else "" queryables: Dict[str, Any] = { - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://stac-api.example.com/queryables", + "$schema": "https://json-schema.org/draft-07/schema", + "$id": f"{url_str}", "type": "object", "title": "Queryables for STAC API", "description": "Queryable names for the STAC API Item Search filter.", @@ -49,13 +52,11 @@ async def get_queryables( if not collection_id: return queryables - properties: Dict[str, Any] = queryables["properties"] - queryables.update( - { - "properties": properties, - "additionalProperties": False, - } - ) + properties: Dict[str, Any] = queryables["properties"].copy() + queryables.update({ + "properties": properties, + "additionalProperties": False, + }) mapping_data = await self.database.get_items_mapping(collection_id) mapping_properties = next(iter(mapping_data.values()))["mappings"]["properties"]