diff --git a/API-strategie-modules/geospatial/crs.md b/API-strategie-modules/geospatial/crs.md index 9ca6c942..1af5fbe2 100644 --- a/API-strategie-modules/geospatial/crs.md +++ b/API-strategie-modules/geospatial/crs.md @@ -16,7 +16,7 @@ A client shall be able to determine a list of CRSs supported by an API.

CRS-LIST: Provide a list of all CRSs that are supported by the API

If a REST API shall comply to the OGC API Features specification then the API must provide an endpoint to determine a list of supported CRSs.

-
+  
   // GET /api/v1/collections:

How to test

If a REST API does not have to comply to the OGC API Features specification, e.g. when the API is used for administrative purposes, then the API shall also provide an endpoint to determine the supported CRSs.

-
+  
   // GET /api/v1/crss:

How to test

    diff --git a/API-strategie-modules/geospatial/request-response.md b/API-strategie-modules/geospatial/request-response.md index 22a7e92d..664308d7 100644 --- a/API-strategie-modules/geospatial/request-response.md +++ b/API-strategie-modules/geospatial/request-response.md @@ -25,7 +25,7 @@ GeoJSON does not cover all use cases. For example, it is not possible to store c - Use a workaround, e.g. convert circular lines / arcs to regular linestrings. Example of embedding WKT in a JSON object using the following definition for a JSON object: -
    +
     building:
       type: object
       required:
    @@ -36,7 +36,7 @@ building:
           format: wkt
     
    Sample response: -
    +
     {
       "building": {
         "geometry": "POLYGON Z((194174.445 465873.676 0, 194174.452 465872.291 0, 194158.154 465872.213 0, 194158.226 465856.695 0, 194223.89 465856.969 0, 194223.821 465872.48 0, 194207.529 465872.415 0, 194207.505 465882.528 0, 194207.498 465883.902 0, 194223.799 465883.967 0, 194223.732 465899.48 0, 194216.55 465899.45 0, 194215.15 465899.445 0, 194213.85 465899.439 0, 194158.068 465899.211 0, 194158.148 465883.685 0, 194174.42 465883.767 0, 194174.445 465873.676 0))"
    @@ -45,7 +45,7 @@ Sample response:
     
    Example of embedding WKB in a JSON object using the following definition for a JSON object: -
    +
     building:
       type: object
       required:
    @@ -56,7 +56,7 @@ building:
           format: wkb
     
    Sample response: -
    +
     {
       "building": {
         "geometry": "01030000A0F71C00000100000012000000F6285C8FF3B30741105839B4466F1C4100000000000000000E2DB29DF3B307416DE7FB29416F1C4100000000000000001D5A643B71B3074108AC1CDA406F1C4100000000000000008716D9CE71B307417B14AEC7026F1C410000000000000000EC51B81E7FB50741378941E0036F1C410000000000000000B07268917EB50741B81E85EB416F1C4100000000000000001D5A643BFCB407418FC2F5A8416F1C410000000000000000A4703D0AFCB407413108AC1C6A6F1C4100000000000000008B6CE7FBFBB4074154E3A59B6F6F1C410000000000000000AC1C5A647EB507417D3F35DE6F6F1C410000000000000000E5D022DB7DB50741B81E85EBAD6F1C4100000000000000006666666644B50741CDCCCCCCAD6F1C4100000000000000003333333339B507417B14AEC7AD6F1C410000000000000000CDCCCCCC2EB507414C3789C1AD6F1C4100000000000000008195438B70B307414E6210D8AC6F1C410000000000000000BE9F1A2F71B30741D7A370BD6E6F1C410000000000000000C3F5285CF3B30741B07268116F6F1C410000000000000000F6285C8FF3B30741105839B4466F1C410000000000000000"
    @@ -73,7 +73,7 @@ A simple spatial filter can be supplied as a bounding box. This is a common way
     

    BBOX-QUERY-PARAMETER: Supply a simple spatial filter as a bounding box parameter

    Support the OGC API Features part 1 bbox query parameter in conformance to the standard.

    -
    +  
         GET /api/v1/buildings?bbox=5.4,52.1,5.5,53.2

    Note that if a resource contains multiple geometries, it is up to the provider to decide if a single or multiple geometries are returned and that the provider shall clearly document this behavior.

    @@ -111,7 +111,7 @@ However, until the filtering module is written, the geospatial module retains ru

    GEOMETRIC-CONTEXT: Place results of a global spatial query in the relevant geometric context

    In case of a global query /api/v1/_search, results should be placed in the relevant geometric context, because results from different collections, i.e. different sets of resources of the same type, are retrieved. Express the name of the collection to which the results belong in the singular form using the property type. For example:

    -
    +  
       // POST /api/v1/_search:
       {
         "currentPage": 1,
    @@ -153,9 +153,9 @@ In case a REST API shall comply to the OGC API Features specification for creati
       

    GEOJSON-REQUEST: Support GeoJSON in geospatial API requests

    For representing geometric information in an API, use the convention for describing geometry as defined in the GeoJSON format [[rfc7946]]. Support GeoJSON as described in OGC API Features part 4, but note that this standard is still in development.

    Example: POST feature -
    -  POST /collections/gebouwen/items   HTTP/1.1
    -  Content-Type: application/geo+json
    +  
    +  // POST /collections/gebouwen/items   HTTP/1.1
    +  // Content-Type: application/geo+json
       {
         "type": "Feature",
         "geometry":  {
    @@ -169,9 +169,9 @@ In case a REST API shall comply to the OGC API Features specification for creati
       }
       
    Example: POST feature collection -
    -  POST /collections   HTTP/1.1
    -  Content-Type: application/geo+json
    +  
    +  // POST /collections   HTTP/1.1
    +  // Content-Type: application/geo+json
       {
         "type": "FeatureCollection",
         "features": [
    @@ -204,9 +204,9 @@ In case a collection of resources is embedded in the request resource, the name
       

    EMBED-GEOJSON-GEOMETRY-REQUEST: Embed GeoJSON Geometry object as part of the JSON resource in API requests

    When a JSON (application/json) request contains a geometry, represent it in the same way as the Geometry object of GeoJSON.

    Example: POST resource containing geometry -
    -  POST /collections/gebouwen/items   HTTP/1.1
    -  Content-Type: application/json
    +  
    +  // POST /collections/gebouwen/items   HTTP/1.1
    +  // Content-Type: application/json
       {
         "naam": "Paleis Soestdijk",
         "geometrie": {
    @@ -216,9 +216,9 @@ In case a collection of resources is embedded in the request resource, the name
       }
       
    Example: POST resource containing geometry collection -
    -  POST /collections/gebouwen/items   HTTP/1.1
    -  Content-Type: application/json
    +  
    +  // POST /collections/gebouwen/items   HTTP/1.1
    +  // Content-Type: application/json
       {
         "naam": "Paleis Soestdijk",
         "geometrie": {
    @@ -249,7 +249,7 @@ In case a REST API shall comply to the OGC API Features specification, e.g. for
       

    GEOJSON-RESPONSE: Support GeoJSON in geospatial API responsess

    For representing 2D geometric information in an API response, use the convention for describing geometry as defined in the GeoJSON format [[rfc7946]]. Support GeoJSON as described in OGC API Features Requirements class 8.3 [[ogcapi-features-1]].

    Example: feature -
    +  
       Request:
       // GET /collections/gebouwen/items/0308100000022041   HTTP 1.1
       // Content-type: application/geo+json
    @@ -274,7 +274,7 @@ In case a REST API shall comply to the OGC API Features specification, e.g. for
       }
    Example: feature collection -
    +  
       Request:
       // GET /collections/gebouwen   HTTP 1.1
       // Content-type: application/geo+json
    @@ -370,7 +370,7 @@ In case a collection of resources is returned, the name of the array containing
       

    When a JSON (application/json) response contains a geometry, represent it in the same way as the Geometry object of GeoJSON.

    Example: resource containing geometry -
    +  
       Request:
       // GET /gebouwen/0308100000022041   HTTP 1.1
       // Content-type: application/hal+json
    @@ -392,7 +392,7 @@ In case a collection of resources is returned, the name of the array containing
       }
    Example: resource containing geometry collection -
    +  
       Request:
       // GET /gebouwen/0308100000022041   HTTP 1.1
       // Content-type: application/hal+json
    @@ -423,7 +423,7 @@ In case a collection of resources is returned, the name of the array containing
       }
    Example: collection of resources containing geometry -
    +  
       Request:
       // GET /gebouwen   HTTP 1.1
       // Content-type: application/hal+json
    @@ -469,11 +469,11 @@ In case a collection of resources is returned, the name of the array containing
         
  • Validate that a response with status code 200 is returned.
  • Validate that Content-Type header contains application/json
  • Validate that the returned document is a JSON document.
  • -
  • Validate that the returned document contains a property that complies to one of the GeoJSON Geometry objects mentioned above and contains:
  • +
  • Validate that the returned document contains a property that complies to one of the GeoJSON Geometry objects mentioned above and contains:
    • a property type containing the name of one of the GeoJSON Geometry object types mentioned above, and
    • a property coordinates containing an array with the coordinates. Depending on the type of geometry object, the content of the array differs.
    • -
    +

Test case 2: @@ -483,11 +483,11 @@ In case a collection of resources is returned, the name of the array containing

  • Validate that a response with status code 200 is returned.
  • Validate that Content-Type header contains application/json
  • Validate that the returned document is a JSON document.
  • -
  • Validate that the returned document contains an array of resources and that each resource contains a property that complies to one of the GeoJSON Geometry objects mentioned above and contains:
  • +
  • Validate that the returned document contains an array of resources and that each resource contains a property that complies to one of the GeoJSON Geometry objects mentioned above and contains:
    • a property type containing the name of one of the GeoJSON Geometry object types mentioned above, and
    • a property coordinates containing an array with the coordinates. Depending on the type of geometry object, the content of the array differs.
    • -
    +
  • Test case 3: @@ -497,11 +497,11 @@ In case a collection of resources is returned, the name of the array containing

  • Validate that a response with status code 200 is returned.
  • Validate that Content-Type header contains application/json
  • Validate that the returned document is a JSON document.
  • -
  • Validate that the returned document contains a property that complies to the GeoJSON Geometry object mentioned above and contains:
  • +
  • Validate that the returned document contains a property that complies to the GeoJSON Geometry object mentioned above and contains:
    • a property type containing the name of the GeoJSON Geometry object type: GeometryCollection, and
    • a property geometries containing an array of GeoJSON Geometry objects.
    • -
    +
  • Test case 4: @@ -511,10 +511,10 @@ In case a collection of resources is returned, the name of the array containing

  • Validate that a response with status code 200 is returned.
  • Validate that Content-Type header contains application/json
  • Validate that the returned document is a JSON document.
  • -
  • Validate that the returned document contains an array of resources and that each resource contains a property that complies to the GeoJSON Geometry object mentioned above and contains:
  • +
  • Validate that the returned document contains an array of resources and that each resource contains a property that complies to the GeoJSON Geometry object mentioned above and contains:
    • a property type containing the name of the GeoJSON Geometry object type: GeometryCollection, and
    • a property geometries containing an array of GeoJSON Geometry objects.
    • -
    +