Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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