Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions docs/source/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,11 @@ The below template provides a minimal example (let's call the file ``mycooledrda

self.covjson = {...}

def get_instances(self):
def instances(self):
return ['foo', 'bar']

def get_instance(self, instance):
return instance in get_instances()
def instance(self, instance):
return instance in instances()

def position(self, **kwargs):
return self.covjson
Expand All @@ -320,8 +320,8 @@ The below template provides a minimal example (let's call the file ``mycooledrda


For brevity, the ``position`` function returns ``self.covjson`` which is a
dictionary of a CoverageJSON representation. ``get_instances`` returns a list
of instances associated with the collection/plugin, and ``get_instance`` returns
dictionary of a CoverageJSON representation. ``instances`` returns a list
of instances associated with the collection/plugin, and ``instance`` returns
a boolean of whether a given instance exists/is valid. EDR query types are subject
to the query functions defined in the plugin. In the example above, the plugin
implements ``position`` and ``trajectory`` queries, which will be advertised as
Expand Down
6 changes: 3 additions & 3 deletions pygeoapi/api/environmental_data_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ def get_collection_edr_instances(api: API, request: APIRequest,

if instance_id is not None:
try:
if p.get_instance(instance_id):
if p.instance(instance_id):
instances = [instance_id]
except ProviderItemNotFoundError:
msg = 'Instance not found'
return api.get_exception(
HTTPStatus.NOT_FOUND, headers, request.format, 'NotFound', msg)
else:
instances = p.get_instances()
instances = p.instances()

for instance in instances:
instance_dict = {
Expand Down Expand Up @@ -281,7 +281,7 @@ def get_collection_edr_query(api: API, request: APIRequest,
err.http_status_code, headers, request.format,
err.ogc_exception_code, err.message)

if instance is not None and not p.get_instance(instance):
if instance is not None and not p.instance(instance):
msg = 'Invalid instance identifier'
return api.get_exception(
HTTPStatus.BAD_REQUEST, headers,
Expand Down
4 changes: 2 additions & 2 deletions pygeoapi/provider/base_edr.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init_subclass__(cls, **kwargs):
'but requests will be routed to a feature provider'
)

def get_instances(self):
def instances(self):
"""
Get a list of instance identifiers

Expand All @@ -87,7 +87,7 @@ def get_instances(self):

return NotImplementedError()

def get_instance(self, instance):
def instance(self, instance):
"""
Validate instance identifier

Expand Down
Loading