OGC API - Records provides geospatial data access functionality to vector data.
To add vector data to pygeoapi, you can use the dataset example in :ref:`configuration` as a baseline and modify accordingly.
pygeoapi core record providers are listed below, along with a matrix of supported query parameters.
| Provider | properties (filters) | resulttype | q | bbox | datetime | sortby | properties (display) | domains | CQL | transactions |
|---|---|---|---|---|---|---|---|---|---|---|
| ElasticsearchCatalogue | ✅ | results/hits | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| TinyDBCatalogue | ✅ | results/hits | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ |
| CSWFacade | ✅ | results/hits | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ |
Below are specific connection examples based on supported providers.
Note
Requires Python packages elasticsearch and elasticsearch-dsl
Note
Elasticsearch 8 or greater is supported.
To publish an Elasticsearch index, the following are required in your index:
- indexes must be documents of valid OGC API - Records GeoJSON Features
- index mappings must define the GeoJSON
geometryas ageo_shape
providers:
- type: record
name: ElasticsearchCatalogue
data: http://localhost:9200/some_metadata_index
id_field: identifier
time_field: datetimefieldThe ES provider also has the support for the CQL queries as indicated in the table above.
.. seealso:: :ref:`cql2` for more details on how to use Common Query Language (CQL) to filter the collection with specific queries.
Note
Requires Python package tinydb
To publish a TinyDB index, the following are required in your index:
- indexes must be documents of valid OGC API - Records GeoJSON Features
providers:
- type: record
editable: true|false # optional, default is false
name: TinyDBCatalogue
data: /path/to/file.db
id_field: identifier
time_field: datetimefieldNote
Requires Python package OWSLib
To publish a CSW using pygeoapi, the CSW base URL (data) is required. Note that the CSW Record core model is supported as a baseline.
providers:
- type: record
name: CSWFacade
data: https://demo.pycsw.org/cite/csw
id_field: identifier
time_field: datetime
title_field: titleSee the :ref:`publishing vector section <including-extra-query-parameters>` for more information on including extra query parameters.
- overview of record collection
- queryables
- queryables on specific properties
- queryables with current domain values
- queryables on specific properties with current domain values
- browse records
- paging
- CSV outputs
- query records (spatial)
- query records (attribute)
- query records (temporal)
- query features (temporal) and sort ascending by a property (if no +/- indicated, + is assumed)
- query features (temporal) and sort descending by a property
- fetch a specific record
Note
provider id_field values support slashes (i.e. my/cool/identifier). The client request would then
be responsible for encoding the identifier accordingly (i.e. http://localhost:5000/collections/my-metadata/items/my%2Fcool%2Fidentifier)