Skip to content

Commit 145e4a2

Browse files
authored
OGC API: add support for collection level transactions (#971)
1 parent 45bc95b commit 145e4a2

File tree

1 file changed

+52
-1
lines changed

1 file changed

+52
-1
lines changed

owslib/ogcapi/features.py

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,57 @@ def collection_queryables(self, collection_id: str) -> dict:
5353
path = f'collections/{collection_id}/queryables'
5454
return self._request(path=path)
5555

56+
def collection_create(self, data: str) -> bool:
57+
"""
58+
implements POST /collections
59+
60+
@type collection_id: string
61+
@type data: string
62+
@param data: collection data
63+
64+
@returns: single collection result
65+
"""
66+
67+
path = 'collections'
68+
69+
self.headers['Content-Type'] = 'application/json'
70+
71+
_ = self._request(method='POST', path=path, data=data)
72+
73+
return True
74+
75+
def collection_update(self, collection_id: str, data: str) -> bool:
76+
"""
77+
implements PUT /collections/{collectionId}
78+
79+
@type collection_id: string
80+
@param collection_id: id of collection
81+
@type data: string
82+
@param data: collection data
83+
84+
@returns: ``bool`` of update result
85+
"""
86+
87+
path = f'collections/{collection_id}'
88+
_ = self._request(method='PUT', path=path, data=data)
89+
90+
return True
91+
92+
def collection_delete(self, collection_id: str) -> bool:
93+
"""
94+
implements DELETE /collections/{collectionId}
95+
96+
@type collection_id: string
97+
@param collection_id: id of collection
98+
99+
@returns: ``bool`` of deletion result
100+
"""
101+
102+
path = f'collections/{collection_id}'
103+
_ = self._request(method='DELETE', path=path)
104+
105+
return True
106+
56107
def collection_items(self, collection_id: str, **kwargs: dict) -> dict:
57108
"""
58109
implements /collection/{collectionId}/items
@@ -145,7 +196,7 @@ def collection_item_update(self, collection_id: str, identifier: str,
145196
@type data: string
146197
@param data: raw representation of data
147198
148-
@returns: ``bool`` of deletion result
199+
@returns: ``bool`` of update result
149200
"""
150201

151202
path = f'collections/{collection_id}/items/{identifier}'

0 commit comments

Comments
 (0)