-
-
Notifications
You must be signed in to change notification settings - Fork 315
Further Fixes for STAC Search #2340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,7 +284,7 @@ def landing_page(api: API, | |
| 'rel': 'search', | ||
| 'type': FORMAT_TYPES[F_JSON], | ||
| 'title': l10n.translate('STAC API search', request.locale), | ||
| 'href': f"{api.base_url}/stac-api//search?f={F_JSON}" | ||
| 'href': f"{api.base_url}/stac-api/search?f={F_JSON}" | ||
| }] | ||
|
|
||
| return headers, status, to_json(content, api.pretty_print) | ||
|
|
@@ -379,9 +379,17 @@ def search(api: API, request: Union[APIRequest, Any]) -> Tuple[dict, int, str]: | |
| geom = from_geojson(json.dumps(feature['geometry'])) | ||
| feature['bbox'] = geom.bounds | ||
|
|
||
| for la in ['links', 'assets']: | ||
| if feature.get(la) is None: | ||
| feature[la] = [] | ||
| if feature.get('links') is None: | ||
| feature['links'] = feature\ | ||
| .get('properties', {})\ | ||
| .get('content', {})\ | ||
| .get('links', []) | ||
|
|
||
| if feature.get('assets') is None: | ||
| feature['assets'] = feature\ | ||
| .get('properties', {})\ | ||
| .get('content', {})\ | ||
| .get('assets', {}) | ||
|
|
||
| stac_api_response['numberReturned'] = len(stac_api_response['features']) | ||
|
|
||
|
|
@@ -488,18 +496,20 @@ def get_temporal(feature: dict) -> dict: | |
| if datetime_ is None and None not in [start_datetime, end_datetime]: | ||
| LOGGER.debug('Temporal range partially exists') | ||
| elif datetime_ is not None: | ||
| value['datetime'] = datetime_ | ||
| LOGGER.debug('Temporal instant exists') | ||
|
|
||
| LOGGER.debug('Attempting to derive temporal from GeoJSON feature') | ||
| LOGGER.debug(feature) | ||
| if feature.get('time') is not None: | ||
| if not value.get('datetime') and feature.get('time') is not None: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we do |
||
| if feature['time'].get('timestamp') is not None: | ||
| value['datetime'] = feature['time']['timestamp'] | ||
| if feature['time'].get('interval') is not None: | ||
| value['start_datetime'] = feature['time']['interval'][0] | ||
| value['end_datetime'] = feature['time']['interval'][1] | ||
|
|
||
| if feature['properties'].get('created') is not None: | ||
| if not value.get('datetime') \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we do |
||
| and feature['properties'].get('created') is not None: | ||
| value['datetime'] = feature['properties']['created'] | ||
|
|
||
| if not value: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the content model that this update is based on? Is
properties.content.linksandproperties.content.assetspart of STAC proper?