Skip to content

Commit

Permalink
OGC API: add support for collection level transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Feb 15, 2025
1 parent 45bc95b commit ee1f0f4
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion owslib/ogcapi/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,57 @@ def collection_queryables(self, collection_id: str) -> dict:
path = f'collections/{collection_id}/queryables'
return self._request(path=path)

def collection_create(self, data: str) -> bool:
"""
implements POST /collections
@type collection_id: string
@type data: string
@param data: collection data
@returns: single collection result
"""

path = 'collections'

self.headers['Content-Type'] = 'application/json'

_ = self._request(method='POST', path=path, data=data)

return True

def collection_update(self, collection_id: str, data: str) -> bool:
"""
implements PUT /collections/{collectionId}
@type collection_id: string
@param collection_id: id of collection
@type data: string
@param data: collection data
@returns: ``bool`` of update result
"""

path = f'collections/{collection_id}'
_ = self._request(method='PUT', path=path, data=data)

return True

def collection_delete(self, collection_id: str) -> bool:
"""
implements DELETE /collections/{collectionId}
@type collection_id: string
@param collection_id: id of collection
@returns: ``bool`` of deletion result
"""

path = f'collections/{collection_id}'
_ = self._request(method='DELETE', path=path)

return True

def collection_items(self, collection_id: str, **kwargs: dict) -> dict:
"""
implements /collection/{collectionId}/items
Expand Down Expand Up @@ -145,7 +196,7 @@ def collection_item_update(self, collection_id: str, identifier: str,
@type data: string
@param data: raw representation of data
@returns: ``bool`` of deletion result
@returns: ``bool`` of update result
"""

path = f'collections/{collection_id}/items/{identifier}'
Expand Down

0 comments on commit ee1f0f4

Please sign in to comment.