This document is licensed under
Creative Commons Attribution 4.0 International Public License
This document is a guideline for Dutch data providers who want to use OGC-API-Features for download services in a way that they comply with relevant standards. The guideline has been written on the basis of the experiences gained from implementations of OGC-API-Features of INSPIRE datasets on test beds. A second important basis is formed by the results of an open tender, held in the beginning of 2023. This tender aimed at adjusting tools for serving OGC-API-feature services to 3 standards: OGC, Dutch Application Design Rules and INSPIRE. Until this tender, no tools were known that comply with all these standards. This guideline describes the requirements, as set out by the standards and uses the demo services from this open tender as an example of how one can comply with the standards. The aim of setting up these test beds and this guideline, has been to stimulate the Dutch data providers and hosting organizations to start publishing data as OGC API Features. By doing this, a greater goal is reached: A better use of geospatial data.
A general recommendation to all parties involved, is to adjust as much as possible to the existing requirements as stated in this document. The most important recommendations for the hosting organizations is to stimulate data providers to start with OGC API features to increase the use of geospatial data according to standards. Data providers are recommended to first orientate on the possible work of other data providers in this field. A roadmap is described with the steps needed to be taken by data providers in order to serve OGC-API-Features.
This is a living document, which is updated regularly.
OGC API Features (OAPIF) is a multi-part standard for services that offer the capability to create, modify, and query spatial data on the Web. It specifies requirements and recommendations for APIs that want to follow a standard way of sharing feature data. The specification is a multi-part document. [PUB-1], [PUB-5], [PUB-6].
OAPIF is also the term used for a feature download service by means of an API (Application Program Interface) based on OGC standards. OAPIF has been considered as the successor of the OGC WFS standard, but that does not mean it will replace it in the near future, although eventually it might. At this moment, they are complementary to each other. Where WFS is mainly known and used in the GIS community, the OAPIF is aiming at the non GIS-community, like web developers. OAPIF is easier to use and needs less knowledge in the spatial domain. Note as well that WFS adopts the Geography Markup Language (GML) as a default data format. In contrast, OAPIF includes recommendations to support HTML and GeoJSON as encodings. Implementations of OAPIF may also optionally support GML.
The basis of an OAPIF is the landing page. Examples are shown in https://geonovum.github.io/ogc-api-features-guideline/#H04. An OAPIF consists of resources that can be retrieved by typing the corresponding path after the landing page of the OAPIF in a web browser or web application.
Resource | Path | Purpose |
---|---|---|
Landing page | / | This is the top-level resource, which serves as an entry point. |
Conformance declaration | /conformance | This resource presents information about the functionality that is implemented by the server. |
API definition | /api | This resource provides metadata about the API itself. Note that the use of /api on the server is optional and the API definition may be hosted on a completely separate server. |
Feature collections | /collections | This resource lists the feature collections that are offered through the API. |
Feature collection | /collections/{collectionId} | This resource describes the feature collection identified in the path. |
Features | /collections/{collectionId}/items | This resource presents the features that are contained in the collection. |
Feature | /collections/{collectionId}/items/{featureId} | This resource presents the feature that is identified in the path. |
In the API definition, one can find all the supported encodings (HTML, JSON) and parameters that can be given along with the URL, such as a bounding box or a limit of the amount of features. By default, an OAPIF service will provide access to a single dataset. Rather than sharing the data as a complete dataset, the OGC API Features standards offer direct, fine-grained access to the data at the feature (object) level.
The best way of understanding the concept is looking at the examples that are discussed in the chapter of examples.
Since providing a download service is an INSPIRE requirement when responsible for an INSPIRE dataset, the use of OAPIF can be considered for this purpose. It is even seen as an endorsed Good Practice within the INSPIRE community.
While the OAPIF is aiming at the non GIS-community, it is also easy to use for GIS-specialists within a GIS as is shown in the image below.
It works the same as loading a WFS. Only a service name and landing page is required.
The following steps could be considered to follow in order to serve an OGC API Feature service according to the standards:
OGC:API features
.Below the most relevant requirements (or requirement classes) for setting up an OAPIF are listed:
Nr | Source | requirements | reference |
---|---|---|---|
1 | OAS | Open API Specification | https://www.openapis.org/ |
2 | OGC | OGC API Features Core | [PUB-1] |
3 | OGC | CRS requirements | [PUB-5] |
4 | OGC | OGC filtering | [PUB-6] |
5 | Dutch ADR | Dutch API design rules | [PUB-3] |
6 | INSPIRE | INPSIRE-MIF document: Setting up an INSPIRE Download service based on the OGC API-Features standard | [PUB-2] |
7 | INSPIRE | CRS requirements | [PUB-2] #req-crs |
8 | INSPIRE | multilinguality | [PUB-2] #82-requirements-class-inspire-multilinguality- |
9 | INSPIRE | [predefined download](https://github.com/INSPIRE-MIF/gp-ogc-api-features/blob/master/spec/oapif-inspire-download.md#req-pre-defined | [PUB-2] #req-pre-defined |
10 | INSPIRE | bulk download | [PUB-2] #req-bulk-download |
11 | INSPIRE | GeoJSON | [PUB-2] #req-oapif-json |
12 | INSPIRE | INSPIRE validated GML as input and output | https://inspire.ec.europa.eu/validator/about/ and [PUB-1] #_requirements_classes_for_encodings |
13 | INSPIRE | describing encoding | [PUB-4] |
The Open API Specification as set up by the OpenAPI Initiative requires a document that describes an API or elements of an API. It can mostly be obtained by typing "openapi" behind the URL of the landing page of the service. An OpenAPI document uses and conforms to the OpenAPI Specification. It describes all the possible fields that can or should be used in the OpenAPI document. The OpenAPI document MUST contain at least one paths field, a components field or a webhooks field.
OGC API Features Core, [PUB-1] describes the basic requirements (50) and recommendations (17) according to OGC that one needs to follow, independent of INSPIRE. It describes which paths can be used and what responses one should receive. It does not make the use of the OpenAPI Specification 3.0) mandatory, but if it is used, it gives an extra requirement class. Presumably, this also counts for higher versions of the OpenAPI Specification.
The GeoJSON requirement class in [PUB-1] recommends to support GeoJSON for features with geometry, but as stated in https://docs.opengeospatial.org/is/17-069r4/17-069r4.html#_encodings, no encoding is mandatory.
Metadata links are recommended in [PUB-1] #rec_core_fc-md-descriptions.
There is an INSPIRE validation on the OGC standards for OAPIF available. It tests on OGC requirements, but it does not test the requirements as stated in [PUB-2].
Both OGC and INSPIRE have requirements related to the CRS's used in addition to the basic requirement from the OGC API Features Core standard. The CRS requirement in the OGC API Features Core standard [PUB-1], requires WGS84 for 2D-data and WGS84h for 3D-data as default. The OGC API - Features - Part 2 standard, [PUB-5] prescribes how to support different coordinate systems with OAPIF. Among other requirements, the requirements concern a CRS identifier list, Storage-CRS, a bbox-crs parameter and a content-CRS in the header of the body of the response.
The specification for filtering, [PUB-6] is still a draft version and has therefore not yet been taken into account. Some basic filtering requirements are described in OGC API - Features - Part 1: Core [PUB-1]. This only concerns filtering with a bounding box and on properties.
Dutch data providers are recommended to follow the Dutch API design rules, [PUB-3] and the Geomodule.
For the Dutch data providers, it is recommended to also support RD-coordinatesystem for 2D data or RD +NAP for 3D data. See also: https://docs.geostandaarden.nl/crs/crs.
INSPIRE-MIF document: Setting up an INSPIRE Download service based on the OGC API-Features standard, [PUB-2] describes the specific INSPIRE requirements. Most of them are explained in the next chapters. This document does propose in Note 2 to make it a mandatory requirement for INSPIRE to comply with OAPIF requirements class OpenAPI 3.0.
The INSPIRE-CRS requirement class in [PUB-2] requires also one of the INSPIRE CRS's based on ETRS89 to be supported.
The multilinguality requirement class, [PUB-2] is mandatory for all data sets that contain information in more than one natural language. This is mostly not the case in the Netherlands, so it is of less importance.
The predefined download requirement class,[PUB-2] consists of 3 requirements for each collection to include links to:
The bulk download requirement class, [PUB-2] requires links for enclosure of the total data set and/or of each separate collection.
The GeoJSON requirement class in [PUB-2] recommends to document how the GeoJSON encoding is retrieved from the INSPIRE data models.
The use of GML as encoding for INSPIRE data can be considered in two ways: as input and as output.
When we consider the input, one would like to be able to use a source dataset of harmonized data. In most cases, this will be a GML encoded dataset.
The GML encoding is at least needed to validate the data set with the EU INSPIRE validator.
Unfortunately, not many tooling for creating a OAPIF service is able to use GML as input. Especially when it concerns a complex GML dataset. So, a transformation to another encoding like GeoJSON is needed.
Output of GML from the OAPIF service can only be in simple features level 0 and level 2. So no complex features will be supported.
The standards considered in this guideline do not set a specific encoding as mandatory (see https://docs.opengeospatial.org/is/17-069r4/17-069r4.html#_encodings) [PUB-1]. If another encoding than GML is used for publishing an INSPIRE dataset, data providers need to document how the encoding relates to the concerned INSPIRE data model. The good practice on GeoPackages encoding of INSPIRE datasets describes how this can be done.
Relevant documentation is shown in appendix A. References.
From earlier tests Geonovum concluded tools were not compliant with the requirements for OAS, OGC, INSPIRE and Dutch ADR. For that reason Geonovum set up an open tender at the beginning of the year 2023, with the goal of improving the compliance of OGC API tooling. This resulted in 3 demo services that each show how you can be compliant with the requirements. All demo services used the same selection of the Dutch INSPIRE Addresses in a simplified GML file, constructed by Wetransform as input.
tool | main contributions | landing page |
---|---|---|
Pygeoapi | Justobjects and Geocat | https://apitestbed.geonovum.nl/adr_pygeoapi/v1 |
Geoserver | Geosolutions | https://geonovum.geosolutionsgroup.com/geoserver/inspire/ogc/features/v1 |
Deegree | Wetransform | https://test.haleconnect.de/ogcapi/datasets/simplified-addresses/v1 |
Per tool, findings are elaborated in the next chapters when relevant.
The following findings show how Pygeoapi complies to the requirements.
The OAS document is available: https://apitestbed.geonovum.nl/adr_pygeoapi/v1/openapi
The OGC CITE validator gave no error at the landing page.
Filtering
For the use of filters, the bbox and items options were already available. In addition, one can filter on the attributes which can be retrieved from https://apitestbed.geonovum.nl/adr_pygeoapi/v1/collections/AddressesNL/queryables. The OGC API specification for filtering [PUB-6] does not yet have the status "approved" and has not yet been considered.
CRS
The crs identifier list and storage-crs can be found at the end of: https://apitestbed.geonovum.nl/adr_pygeoapi/v1/collections/AddressesNL?f=json
With the following command line request, one can see the Content-CRS value in the header:
curl -i https://apitestbed.geonovum.nl/adr_pygeoapi/v1/collections/AddressesNL/items/1?f=json
An adjustment has been made to the bbox filter. It now also supports the bbox-crs parameter. Only 2 addresses are available in the below defined bbox. https://apitestbed.geonovum.nl/adr_pygeoapi/v1/collections/AddressesNL/items?f=json&bbox-crs=http://www.opengis.net/def/crs/EPSG/0/28992&bbox=252200,593000,252710,594000
It complies with all the rules, except for rule https://publicatie.centrumvoorstandaarden.nl/api/adr/#api-48. This rule in the Dutch ADR prescribes that none of the API endpoints should have a trailing slash. However, the OGC specification states that the landing page (i.e. "Home") should have a trailing slash. So the rules contradict. It is expected that in future, this ADR-rule will make an exception for the landing page.
CRS ETRS89 and WGS84
The required CRS's are available:
Predefined download
Link to metadata of dataset: passed at /collections/AddressesNL
and at /collections
level:{"href": "https://www.nationaalgeoregister.nl/geonetwork/srv/dut/catalog.search#/metadata/a5f961e9-ebdd-41e2-b8e8-ab33ed340a83", "hreflang": "nl", "type": "text/html", "rel": "describedby", "title": "Metadata as HTML"}
{"href": "https://www.nationaalgeoregister.nl/geonetwork/srv/api/records/a5f961e9-ebdd-41e2-b8e8-ab33ed340a83/formatters/xml", "hreflang": "nl", "type": "application/xml", "rel": "describedby", "title": "Metadata as ISO 19139 XML"}
Link to INSPIRE feature concept dictionary: passed at /collections/AddressesNL and at /collections level:{"href": "https://inspire.ec.europa.eu/featureconcept/Address", "hreflang": "en", "type": "text/html", "rel": "tag", "title": "INSPIRE feature concept dictionary for addresses"}
Link to the license: passed at /collections/AddressesNL and at /collections level:{"href": "https://creativecommons.org/publicdomain/zero/1.0/deed.en", "hreflang": "en", "type": "text/html", "rel": "license", "title": "CC0 1.0 Public Domain license"}
See also https://apitestbed.geonovum.nl/adr_pygeoapi/v1/collections?f=json and https://apitestbed.geonovum.nl/adr_pygeoapi/v1/collections/AddressesNL?f=json
bulk download
Link to bulk download of dataset: passed at /collections/AddressesNL and at /collections level.
See also https://apitestbed.geonovum.nl/adr_pygeoapi/v1/collections?f=json and
https://apitestbed.geonovum.nl/adr_pygeoapi/v1/collections/AddressesNL?f=json
{"href": "https://service.pdok.nl/kadaster/ad/atom/downloads/addresses.gml.gz", "hreflang": "nl", "length": 685450191, "type": "application/x-gmz", "rel": "enclosure", "title": "Download complete dataset as GML"}
GeoJSON
Items can be retrieved in GeoJSON by requesting:
https://apitestbed.geonovum.nl/adr_pygeoapi/v1/collections/AddressesNL/items?f=json
GML
As input, a simple features GML file was used as produced by Wetransform from the complex feature GML with the transformation software Hale.
As output, there is a link to the original complex feature GML-file: https://service.pdok.nl/kadaster/ad/atom/downloads/addresses.gml.gz
Pygeoapi does not support GML-output at item-level, but this is not a requirement.
Describing encoding
There is a link to https://github.com/INSPIRE-MIF/2017.2/tree/master/GeoJSON/ads at collections/AddressesNL level:
{"href": "https://github.com/INSPIRE-MIF/2017.2/tree/master/GeoJSON/ads", "hreflang": "en", "type": "text/html", "rel": "about", "title": "Description of the encoding"}
More information about the Pygeoapi adjustments to the standards can be found at https://pygeoapi.io/presentations/geonovum-tender-2023/
The following findings show how Geoserver complies to the requirements.
The OAS document is available: https://geonovum.geosolutionsgroup.com/geoserver/inspire/ogc/features/v1/openapi
The OGC CITE validator gave no error at the landing page https://geonovum.geosolutionsgroup.com/geoserver/inspire/ogc/features/v1.
Filtering
For the use of filters, the bbox and items options were already available. In addition, one can filter on the attributes which can be retrieved from: https://geonovum.geosolutionsgroup.com/geoserver/inspire/ogc/features/v1/collections/Addresses?queryables.
The OGC API specification for filtering [PUB-6] does not yet have the status "approved" and has not yet been considered.
CRS
The crs identifier list and the storage-crs can be found at: https://geonovum.geosolutionsgroup.com/geoserver/inspire/ogc/features/v1/collections/SimpleAddress?f=json
With the following command line request, one can see the Content-CRS value in the header :
curl -i https://geonovum.geosolutionsgroup.com/geoserver/inspire/ogc/features/v1/collections/SimpleAddress/items/1?f=json
An adjustment has been made to the bbox filter. It now also supports the bbox-crs parameter. Only 2 addresses are available in the below defined bbox.
It complies with all the rules, except for rule https://publicatie.centrumvoorstandaarden.nl/api/adr/#api-48. This rule in the Dutch ADR prescribes that none of the API endpoints should have a trailing slash. However, the OGC specification states that the landing page (i.e. "Home") should have a trailing slash. So the rules contradict. It is expected that in future, this ADR-rule will make an exception for the landing page.
CRS ETRS89 and WGS84
The required CRS's are available:
Predefined download
Link to metadata of dataset: passed at /collections/collection level and at /collections level.
{"href":"https://www.nationaalgeoregister.nl/geonetwork/srv/api/records/a5f961e9-ebdd-41e2-b8e8-ab33ed340a83/formatters/xml?approved=true","rel":"describedBy","type":"application/xml","title":"ISO metadata for this dataset"}
Link to INSPIRE feature concept dictionary: passed at /collections/collection level.
{"href":"https://inspire.ec.europa.eu/featureconcept/Address","rel":"tag","type":"text/html","title":"INSPIRE Address feature concept."}
Link to the license: passed at /collections level.
{"href":"http://creativecommons.org/publicdomain/zero/1.0/deed.nl","rel":"license","type":"text/html","title":"Dataset license."}
bulk download
Link to bulk download of dataset: passed at /collections/collection level.{"href":"https://geonovum.geosolutionsgroup.com/geoserver/www/ADNL.gpkg","rel":"enclosure","type":"application/geopackage+sqlite3","title":"Addresses raw data."}
GeoJSON
Items can be retrieved in GeoJSON by requesting:
https://geonovum.geosolutionsgroup.com/geoserver/inspire/ogc/features/v1/collections/SimpleAddress/items/1?f=application%2Fgeo%2Bjson
GML
As input, a simple features GML file was used as produced by Wetransform from the complex feature GML with the transformation software Hale.
As output, the following link can be found at /collections/collection level. It can be used to download the first 50 records.
{"href":"https://geonovum.geosolutionsgroup.com/geoserver/inspire/ogc/features/v1/collections/SimpleAddress/items?f=application%2Fgml%2Bxml%3Bversion%3D3.2","rel":"items","type":"application/gml+xml;version=3.2","title":"Addresses items as application/gml+xml;version=3.2"}
Describing encoding
There is a link to https://github.com/INSPIRE-MIF/2017.2/blob/master/GeoJSON/ads/simple-addresses.md at /collections/collection level.
{"href":"https://github.com/INSPIRE-MIF/2017.2/blob/master/GeoJSON/ads/simple-addresses.md","rel":"describedBy","type":"text/html","title":"GeoJSON Encoding Rule for INSPIRE Addresses"}
More information about the Geoserver adjustments to the standards can be found at https://www.geonovum.nl/uploads/documents/Geosolutions.pdf
The following findings show how Geoserver complies to the requirements.
The OAS document is available: https://test.haleconnect.de/ogcapi/datasets/simplified-addresses/v1/openapi
The OGC CITE validator gave no error at the landing page: https://test.haleconnect.de/ogcapi/datasets/simplified-addresses/v1.
Filtering
For the use of filters, the bbox and items options were already available.
The OGC API specification for filtering [PUB-6] does not yet have the status "approved" and has not yet been considered.
CRS
The crs identifier list and storage-crs can be found at: https://test.haleconnect.de/ogcapi/datasets/simplified-addresses/v1/collections/SimpleAddress?f=json
With the following command line request, one can see the Content-CRS value in the header :
curl -i https://test.haleconnect.de/ogcapi/datasets/simplified-addresses/v1/collections/SimpleAddress/items?limit=1
An adjustment has been made tot the bbox filter. It now also supports the bbox-crs parameter. Only 2 addresses are available in the below defined bbox. https://test.haleconnect.de/ogcapi/datasets/simplified-addresses/v1/collections/SimpleAddress/items?f=json&bbox-crs=http://www.opengis.net/def/crs/EPSG/0/28992&bbox=252200,593000,252710,594000
It complies with all the rules, except for rule https://publicatie.centrumvoorstandaarden.nl/api/adr/#api-48. This rule in the Dutch ADR prescribes that none of the API endpoints should have a trailing slash. However, the OGC specification states that the landing page (i.e. "Home") should have a trailing slash. So the rules contradict. It is expected that in future, this ADR-rule will make an exception for the landing page.
CRS ETRS89 and WGS84
The required CRS's are available:
Predefined download
Link to metadata of dataset: passed at /collections level:
{"href":"https://www.nationaalgeoregister.nl/geonetwork/srv/dut/catalog.search#/metadata/a5f961e9-ebdd-41e2-b8e8-ab33ed340a83","rel":"describedby","type":"text/html","title":"Metadata"}
Link to INSPIRE feature concept dictionary: passed at /collections/collection level and at /collections level:
{"href":"https://inspire.ec.europa.eu/featureconcept/Address","rel":"tag","type":"text/html","title":"Feature concept Address"}
Link to the license: passed at /collections level:
{"href":"http://creativecommons.org/publicdomain/zero/1.0/deed.nl","rel":"license","type":"text/html","title":"License"}
bulk download
Link to bulk download of dataset: passed at /collections/collection level and at /collections level.
{"href":"http://test.haleconnect.de/ogcapi/datasets/simplified-addresses/collections/SimpleAddress/items?bulk=true","rel":"enclosure","type":"application/xml","title":"Download all features as GML"}
{"href":"http://test.haleconnect.de/ogcapi/datasets/simplified-addresses/collections/SimpleAddress/items?bulk=true","rel":"enclosure","type":"application/json","title":"Download all features as GeoJSON"}
GeoJSON
Items can be retrieved in GeoJSON by requesting:
https://test.haleconnect.de/ogcapi/datasets/simplified-addresses/collections/SimpleAddress/items?f=json&limit=1
or
https://test.haleconnect.de/ogcapi/datasets/simplified-addresses/collections/SimpleAddress/items/nl-imbag-ad-address-0003200000133985?f=json
GML
As input, a simple features GML file was used as produced by Wetransform from the complex feature GML with the transformation software Hale. As output, the following links can be found at /collections/collection level. They can be used to download specific records.
{"href":"http://test.haleconnect.de/ogcapi/datasets/simplified-addresses/collections/SimpleAddress/items?bulk=true","rel":"enclosure","type":"application/xml","title":"Download all features as GML"}
or
{"href":"http://test.haleconnect.de/ogcapi/datasets/simplified-addresses/collections/SimpleAddress/items","rel":"items","type":"application/gml+xml;version=3.2","title":"Features as GML"}
(use parameter f=xml
)
Describing encoding
There is a link to https://github.com/INSPIRE-MIF/2017.2/blob/master/GeoJSON/ads at /collections/collection level.
{"href":"https://github.com/INSPIRE-MIF/2017.2/tree/master/GeoJSON/ads","rel":"describedby","type":"text/html","title":"Encoding description"}
More information about the Deegree adjustments to the standards can be found at https://www.geonovum.nl/uploads/documents/deegree%20OGC%20API%20Features.pdf
Presentations can be found here: https://www.geonovum.nl/over-geonovum/actueel/presentatie-resultaten-aanbesteding-ogc-api-features-toolaanpassing