Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,845 changes: 1,551 additions & 1,294 deletions Pipfile.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
- [**Development settings (only for local environment and DEV staging)**](#development-settings-only-for-local-environment-and-dev-staging)
- [Utility scripts](#utility-scripts)
- [Updating Packages](#updating-packages)
- [publiccode.yaml](#publiccodeyaml)

## Summary of the project

Expand Down Expand Up @@ -583,3 +584,8 @@ pipenv install logging-utilities~=5.0
Or you can also use the script named "update_to_latest.sh" to automatically update the version
strings of the dependencies in the Pipfile. See the comment at the top of the script to learn how
to use it.

## publiccode.yaml

This file adds the repository to catalogs like the [OSS Catalogue](https://opensource.admin.ch) by the Swiss Confederation.
It follows a [metadata standard](https://yml.publiccode.tools/) for repositories with software developed by public administrations.
3 changes: 0 additions & 3 deletions app/config/settings_prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,6 @@ def get_logging_config():
'DISALLOWED_EXTERNAL_ASSET_URL_SCHEMES', default=['http']
)

# Feature flag to hide/show expired items in the search endpoint
HIDE_EXPIRED_ITEMS_IN_SEARCH = env('HIDE_EXPIRED_ITEMS_IN_SEARCH', bool, default=True)

# These are the default values from Django as per
# https://docs.djangoproject.com/en/5.1/ref/settings/
# We add them here so they can be changed through environment variables.
Expand Down
7 changes: 2 additions & 5 deletions app/stac_api/views/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,8 @@ class SearchList(generics.GenericAPIView, mixins.ListModelMixin):

# pylint: disable=too-many-branches
def get_queryset(self):
filter_condition = Q(collection__published=True)
if settings.HIDE_EXPIRED_ITEMS_IN_SEARCH:
is_active = create_is_active_filter()
filter_condition &= is_active
queryset = Item.objects.filter(filter_condition).prefetch_related('assets', 'links')
queryset = Item.objects.filter(Q(collection__published=True) & create_is_active_filter()
).prefetch_related('assets', 'links')

# harmonize GET and POST query
query_param = harmonize_post_get_for_search(self.request)
Expand Down
47 changes: 47 additions & 0 deletions publiccode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
publiccodeYmlVersion: 0.4.0
name: STAC API
applicationSuite: geo.admin.ch
url: https://github.com/geoadmin/service-stac.git
landingURL: https://github.com/geoadmin/service-stac
platforms:
- web
categories:
- geographic-information-systems
usedBy:
- Federal Office of Topography swisstopo
- Federal Office of Meteorology and Climatology MeteoSwiss
developmentStatus: stable
softwareType: standalone/web
description:
en:
localisedName: STAC API
shortDescription: The STAC API to interact with Swiss federal geodata
longDescription: The STAC API of geo.admin.ch consists of standardized RESTful
API endpoints designed for interacting with federal geodata. All datasets
are organized according to the SpatioTemporal Asset Catalog (STAC)
specification, which simplifies data discovery and usage. This STAC API
implementation conforms to the core STAC API specification. The underlying
data model follows the STAC schema and is extended by the forecast
extension to support weather forecast data.
documentation: https://www.geo.admin.ch/en/rest-interface-stac-api
apiDocumentation: https://data.geo.admin.ch/api/stac/static/spec/v1/api.html
features:
- List geodata organized into collections, items and assets (STAC compatible)
- Search items by field value or by spatial criteria, e.g., a bounding box
- Data management of a STAC catalog, like uploading and deleting assets
- Web UI to browse, preview and manage the STAC catalog
- Specifications of the API in a website as OpenAPI definition
- Support of weather forecast data through an extension of the data model
legal:
license: BSD-3-Clause-Modification
maintenance:
type: internal
contacts:
- name: Helpdesk geo.admin.ch
email: info@geo.admin.ch
phone: +41 58 469 01 11
affiliation: Swisstopo
localisation:
localisationReady: false
availableLanguages:
- en
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion spec/components/responses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ components:
rel: search
type: application/json
title: Search across feature collections
stac_version: 0.9.0
stac_version: 1.0.0
title: data.geo.admin.ch
type: Catalog
conformsTo:
Expand Down
2 changes: 1 addition & 1 deletion spec/components/schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ components:
description: The search criteria
type: object
stac_version:
example: 0.9.0
example: 1.0.0
title: STAC version
type: string
readOnly: true
Expand Down
4 changes: 3 additions & 1 deletion spec/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ info:
contact:
name: API Specification (based on STAC)
url: http://data.geo.admin.ch/api/stac/v1/
description: >-
description: |
This is an OpenAPI definition of the API to query and access federal geodata on
data.geo.admin.ch. The API is based on the core SpatioTemporal Asset Catalog API specification
[STAC](http://stacspec.org) and adds two extensions for extended searching possibilities.

Find tutorials, examples and best practices around the STAC API in the [Tech Docs](https://docs.geo.admin.ch/download-data/stac-api/overview.html).
title: The SpatioTemporal Asset Catalog API for data.geo.admin.ch
version: 1.0.0
servers:
Expand Down
Binary file removed spec/static/assets/service-stac-upload-process.dia
Binary file not shown.
Loading
Loading