Skip to content

Commit

Permalink
editorial
Browse files Browse the repository at this point in the history
  • Loading branch information
lvdbrink committed Apr 14, 2023
1 parent a304444 commit d25eceb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions API-strategie-modules/geospatial/crs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A client shall be able to determine a list of CRSs supported by an API.
<div class="rule" id="crs-list">
<p class="rulelab"><strong>CRS-LIST</strong>: Provide a list of all CRSs that are supported by the API</p>
<p>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.</p>
<pre>
<pre class="example">
// GET /api/v1/collections:</pre>
<h4 class="rulelab">How to test</h4>
<ul>
Expand All @@ -27,7 +27,7 @@ A client shall be able to determine a list of CRSs supported by an API.
</ul>

<p>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.</p>
<pre>
<pre class="example">
// GET /api/v1/crss:</pre>
<h4 class="rulelab">How to test</h4>
<ul>
Expand Down
62 changes: 31 additions & 31 deletions API-strategie-modules/geospatial/request-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
<pre>
<pre class="example">
building:
type: object
required:
Expand All @@ -36,7 +36,7 @@ building:
format: wkt
</pre>
Sample response:
<pre>
<pre class="example">
{
"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))"
Expand All @@ -45,7 +45,7 @@ Sample response:
</pre>

Example of embedding WKB in a JSON object using the following definition for a JSON object:
<pre>
<pre class="example">
building:
type: object
required:
Expand All @@ -56,7 +56,7 @@ building:
format: wkb
</pre>
Sample response:
<pre>
<pre class="example">
{
"building": {
"geometry": "01030000A0F71C00000100000012000000F6285C8FF3B30741105839B4466F1C4100000000000000000E2DB29DF3B307416DE7FB29416F1C4100000000000000001D5A643B71B3074108AC1CDA406F1C4100000000000000008716D9CE71B307417B14AEC7026F1C410000000000000000EC51B81E7FB50741378941E0036F1C410000000000000000B07268917EB50741B81E85EB416F1C4100000000000000001D5A643BFCB407418FC2F5A8416F1C410000000000000000A4703D0AFCB407413108AC1C6A6F1C4100000000000000008B6CE7FBFBB4074154E3A59B6F6F1C410000000000000000AC1C5A647EB507417D3F35DE6F6F1C410000000000000000E5D022DB7DB50741B81E85EBAD6F1C4100000000000000006666666644B50741CDCCCCCCAD6F1C4100000000000000003333333339B507417B14AEC7AD6F1C410000000000000000CDCCCCCC2EB507414C3789C1AD6F1C4100000000000000008195438B70B307414E6210D8AC6F1C410000000000000000BE9F1A2F71B30741D7A370BD6E6F1C410000000000000000C3F5285CF3B30741B07268116F6F1C410000000000000000F6285C8FF3B30741105839B4466F1C410000000000000000"
Expand All @@ -73,7 +73,7 @@ A simple spatial filter can be supplied as a bounding box. This is a common way
<div class="rule" id="bbox-query-parameter">
<p class="rulelab"><strong>BBOX-QUERY-PARAMETER</strong>: Supply a simple spatial filter as a bounding box parameter</p>
<p>Support the <a href="https://docs.ogc.org/is/17-069r4/17-069r4.html#_parameter_bbox">OGC API Features part 1 <code>bbox</code> query parameter</a> in conformance to the standard.</p>
<pre>
<pre class="example">
GET /api/v1/buildings?bbox=5.4,52.1,5.5,53.2</pre>
<p>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.
</p>
Expand Down Expand Up @@ -111,7 +111,7 @@ However, until the filtering module is written, the geospatial module retains ru
<div class="rule" id="geometric-context">
<p class="rulelab"><strong>GEOMETRIC-CONTEXT</strong>: Place results of a global spatial query in the relevant geometric context</p>
<p>In case of a global query <code>/api/v1/_search</code>, results should be placed in the relevant geometric context, because results from different <a href="https://publicatie.centrumvoorstandaarden.nl/api/adr/#resources">collections</a>, 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 <code>type</code>. For example:</p>
<pre>
<pre class="example">
// POST /api/v1/_search:
{
"currentPage": 1,
Expand Down Expand Up @@ -153,9 +153,9 @@ In case a REST API shall comply to the OGC API Features specification for creati
<p class="rulelab"><strong>GEOJSON-REQUEST</strong>: Support GeoJSON in geospatial API requests</p>
<p>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 <a href="http://docs.ogc.org/DRAFTS/20-002.html">OGC API Features part 4</a>, but note that this standard is still in development.</p>
Example: POST feature
<pre>
POST /collections/gebouwen/items HTTP/1.1
Content-Type: application/geo+json
<pre class="example">
// POST /collections/gebouwen/items HTTP/1.1
// Content-Type: application/geo+json
{
"type": "Feature",
"geometry": {
Expand All @@ -169,9 +169,9 @@ In case a REST API shall comply to the OGC API Features specification for creati
}
</pre>
Example: POST feature collection
<pre>
POST /collections HTTP/1.1
Content-Type: application/geo+json
<pre class="example">
// POST /collections HTTP/1.1
// Content-Type: application/geo+json
{
"type": "FeatureCollection",
"features": [
Expand Down Expand Up @@ -204,9 +204,9 @@ In case a collection of resources is embedded in the request resource, the name
<p class="rulelab"><strong>EMBED-GEOJSON-GEOMETRY-REQUEST</strong>: Embed GeoJSON <code>Geometry</code> object as part of the JSON resource in API requests</p>
<p>When a JSON (<code>application/json</code>) request contains a geometry, represent it in the same way as the <code>Geometry</code> object of GeoJSON.</p>
Example: POST resource containing geometry
<pre>
POST /collections/gebouwen/items HTTP/1.1
Content-Type: application/json
<pre class="example">
// POST /collections/gebouwen/items HTTP/1.1
// Content-Type: application/json
{
"naam": "Paleis Soestdijk",
"geometrie": {
Expand All @@ -216,9 +216,9 @@ In case a collection of resources is embedded in the request resource, the name
}
</pre>
Example: POST resource containing geometry collection
<pre>
POST /collections/gebouwen/items HTTP/1.1
Content-Type: application/json
<pre class="example">
// POST /collections/gebouwen/items HTTP/1.1
// Content-Type: application/json
{
"naam": "Paleis Soestdijk",
"geometrie": {
Expand Down Expand Up @@ -249,7 +249,7 @@ In case a REST API shall comply to the OGC API Features specification, e.g. for
<p class="rulelab"><strong>GEOJSON-RESPONSE</strong>: Support GeoJSON in geospatial API responsess</p>
<p>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 <a href="https://docs.ogc.org/is/17-069r3/17-069r3.html#_requirements_class_geojson">Requirements class 8.3</a> [[ogcapi-features-1]]. </p>
Example: feature
<pre>
<pre class="example">
Request:
// GET /collections/gebouwen/items/0308100000022041 HTTP 1.1
// Content-type: application/geo+json
Expand All @@ -274,7 +274,7 @@ In case a REST API shall comply to the OGC API Features specification, e.g. for
}</pre>

Example: feature collection
<pre>
<pre class="example">
Request:
// GET /collections/gebouwen HTTP 1.1
// Content-type: application/geo+json
Expand Down Expand Up @@ -370,7 +370,7 @@ In case a collection of resources is returned, the name of the array containing
<p>When a JSON (<code>application/json</code>) response contains a geometry, represent it in the same way as the <code>Geometry</code> object of GeoJSON.</p>

Example: resource containing geometry
<pre>
<pre class="example">
Request:
// GET /gebouwen/0308100000022041 HTTP 1.1
// Content-type: application/hal+json
Expand All @@ -392,7 +392,7 @@ In case a collection of resources is returned, the name of the array containing
}</pre>

Example: resource containing geometry collection
<pre>
<pre class="example">
Request:
// GET /gebouwen/0308100000022041 HTTP 1.1
// Content-type: application/hal+json
Expand Down Expand Up @@ -423,7 +423,7 @@ In case a collection of resources is returned, the name of the array containing
}</pre>

Example: collection of resources containing geometry
<pre>
<pre class="example">
Request:
// GET /gebouwen HTTP 1.1
// Content-type: application/hal+json
Expand Down Expand Up @@ -469,11 +469,11 @@ In case a collection of resources is returned, the name of the array containing
<li>Validate that a response with status code 200 is returned.</li>
<li>Validate that <code>Content-Type</code> header contains <code>application/json</code></li>
<li>Validate that the returned document is a JSON document.</li>
<li>Validate that the returned document contains a property that complies to one of the GeoJSON <code>Geometry</code> objects mentioned above and contains:</li>
<li>Validate that the returned document contains a property that complies to one of the GeoJSON <code>Geometry</code> objects mentioned above and contains:
<ul>
<li>a property <code>type</code> containing the name of one of the GeoJSON <code>Geometry</code> object types mentioned above, and</li>
<li>a property <code>coordinates</code> containing an array with the coordinates. Depending on the type of geometry object, the content of the array differs.</li>
</ul>
</ul></li>
</ul>
<p>
Test case 2:
Expand All @@ -483,11 +483,11 @@ In case a collection of resources is returned, the name of the array containing
<li>Validate that a response with status code 200 is returned.</li>
<li>Validate that <code>Content-Type</code> header contains <code>application/json</code></li>
<li>Validate that the returned document is a JSON document.</li>
<li>Validate that the returned document contains an array of resources and that each resource contains a property that complies to one of the GeoJSON <code>Geometry</code> objects mentioned above and contains:</li>
<li>Validate that the returned document contains an array of resources and that each resource contains a property that complies to one of the GeoJSON <code>Geometry</code> objects mentioned above and contains:
<ul>
<li>a property <code>type</code> containing the name of one of the GeoJSON <code>Geometry</code> object types mentioned above, and</li>
<li>a property <code>coordinates</code> containing an array with the coordinates. Depending on the type of geometry object, the content of the array differs.</li>
</ul>
</ul></li>
</ul>
<p>
Test case 3:
Expand All @@ -497,11 +497,11 @@ In case a collection of resources is returned, the name of the array containing
<li>Validate that a response with status code 200 is returned.</li>
<li>Validate that <code>Content-Type</code> header contains <code>application/json</code></li>
<li>Validate that the returned document is a JSON document.</li>
<li>Validate that the returned document contains a property that complies to the GeoJSON <code>Geometry</code> object mentioned above and contains: </li>
<li>Validate that the returned document contains a property that complies to the GeoJSON <code>Geometry</code> object mentioned above and contains:
<ul>
<li>a property <code>type</code> containing the name of the GeoJSON <code>Geometry</code> object type: <code>GeometryCollection</code>, and</li>
<li>a property <code>geometries</code> containing an array of GeoJSON <code>Geometry</code> objects.</li>
</ul>
</ul></li>
</ul>
<p>
Test case 4:
Expand All @@ -511,10 +511,10 @@ In case a collection of resources is returned, the name of the array containing
<li>Validate that a response with status code 200 is returned.</li>
<li>Validate that <code>Content-Type</code> header contains <code>application/json</code></li>
<li>Validate that the returned document is a JSON document.</li>
<li>Validate that the returned document contains an array of resources and that each resource contains a property that complies to the GeoJSON <code>Geometry</code> object mentioned above and contains: </li>
<li>Validate that the returned document contains an array of resources and that each resource contains a property that complies to the GeoJSON <code>Geometry</code> object mentioned above and contains:
<ul>
<li>a property <code>type</code> containing the name of the GeoJSON <code>Geometry</code> object type: <code>GeometryCollection</code>, and</li>
<li>a property <code>geometries</code> containing an array of GeoJSON <code>Geometry</code> objects.</li>
</ul>
</ul></li>
</ul>
</div>

0 comments on commit d25eceb

Please sign in to comment.