Skip to content

Commit 4f8bb8e

Browse files
committed
add docs for OGC API transactions [skip ci]
1 parent 5961b87 commit 4f8bb8e

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

docs/en/features.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ OGC API Support
5858
+--------------------------------------------------------------------------------------+------------+
5959
| `OGC API - Records - Part 1: Core`_ | draft |
6060
+--------------------------------------------------------------------------------------+------------+
61-
| `OGC API - Features - Part 3: Filtering and the Common Query Language (CQL) draft`_ | draft |
61+
| `OGC API - Features - Part 3: Filtering and the Common Query Language (CQL)`_ | draft |
62+
+--------------------------------------------------------------------------------------+------------+
63+
| `OGC API - Features - Part 4: Create, Replace, Update and Delete`_ | draft |
6264
+--------------------------------------------------------------------------------------+------------+
6365
| `OGC API - Processes - Part 1: Core`_ | 1.0 |
6466
+--------------------------------------------------------------------------------------+------------+
@@ -89,6 +91,7 @@ OGC API Support
8991
.. _`OGC API`: https://ogcapi.ogc.org
9092
.. _`OGC API - Features - Part 1: Core`: https://docs.opengeospatial.org/is/17-069r3/17-069r3.html
9193
.. _`OGC API - Records - Part 1: Core`: https://github.com/opengeospatial/ogcapi-records
92-
.. _`OGC API - Features - Part 3: Filtering and the Common Query Language (CQL) draft`: https://docs.ogc.org/DRAFTS/19-079.html
94+
.. _`OGC API - Features - Part 3: Filtering and the Common Query Language (CQL)`: https://docs.ogc.org/DRAFTS/19-079.html
95+
.. _`OGC API - Features - Part 4: Create, Replace, Update and Delete`: https://docs.ogc.org/DRAFTS/20-002.html
9396
.. _`OGC API - Coverages - Part 1: Core`: https://docs.ogc.org/DRAFTS/19-087.html
9497
.. _`OGC API - Processes - Part 1: Core`: https://docs.ogc.org/is/18-062r2/18-062r2.html

docs/en/usage.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,46 @@ OGC API - Records - Part 1: Core 1.0
273273
>>> my_catalogue_cql_json_query['features'][0]['properties']['title']
274274
u'Roadrunner ambush locations'
275275

276+
277+
OGC API - Features - Part 4: Create, Replace, Update and Delete
278+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
279+
280+
.. note::
281+
282+
This specification applies to both OGC API - Features and OGC API - Records
283+
284+
285+
.. code-block:: python
286+
287+
import json
288+
from owslib.ogcapi.records import Records
289+
290+
record_data = '/path/to/record.json'
291+
292+
url = 'http://localhost:8000'
293+
collection_id = 'metadata:main'
294+
295+
r = Records(url)
296+
297+
cat = r.collection(collection_id)
298+
299+
with open(record_data) as fh:
300+
data = json.load(fh)
301+
302+
identifier = data['id']
303+
304+
r.collection_item_delete(collection_id, identifier)
305+
306+
# insert metadata
307+
r.collection_item_create(collection_id, data)
308+
309+
# update metadata
310+
r.collection_item_update(collection_id, identifier, data)
311+
312+
# delete metadata
313+
r.collection_item_delete(collection_id, identifier)
314+
315+
276316
OGC API - Processes - Part 1: Core 1.0
277317
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
278318

0 commit comments

Comments
 (0)