Skip to content

Commit

Permalink
Fix some minor bugs (typo of interpolation type, date-time format, na…
Browse files Browse the repository at this point in the history
…me of the queryable resources)
  • Loading branch information
TaehoonK committed Feb 28, 2024
1 parent edb0e93 commit 111942e
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 125 deletions.
32 changes: 16 additions & 16 deletions pygeoapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,13 +866,13 @@ def describe_collections(self, request: Union[APIRequest, Any]) -> Tuple[dict, i
time = []
lifespan = row[2]
if lifespan is not None:
time.append(lifespan._lower.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(lifespan._upper.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(lifespan._lower.strftime("%Y-%m-%dT%H:%M:%SZ"))
time.append(lifespan._upper.strftime("%Y-%m-%dT%H:%M:%SZ"))
else:
if extend_stbox is not None:
if extend_stbox.tmin is not None:
time.append(extend_stbox.tmin.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(extend_stbox.tmax.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(extend_stbox.tmin.strftime("%Y-%m-%dT%H:%M:%SZ"))
time.append(extend_stbox.tmax.strftime("%Y-%m-%dT%H:%M:%SZ"))

collection['extent'] = {
'spatial': {
Expand Down Expand Up @@ -1064,13 +1064,13 @@ def get_collection(self, request: Union[APIRequest, Any],
time = []
lifespan = row[2]
if lifespan is not None:
time.append(lifespan._lower.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(lifespan._upper.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(lifespan._lower.strftime("%Y-%m-%dT%H:%M:%SZ"))
time.append(lifespan._upper.strftime("%Y-%m-%dT%H:%M:%SZ"))
else:
if extend_stbox is not None:
if extend_stbox.tmin is not None:
time.append(extend_stbox.tmin.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(extend_stbox.tmax.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(extend_stbox.tmin.strftime("%Y-%m-%dT%H:%M:%SZ"))
time.append(extend_stbox.tmax.strftime("%Y-%m-%dT%H:%M:%SZ"))

collection['extent'] = {
'spatial': {
Expand Down Expand Up @@ -1282,13 +1282,13 @@ def get_collection_items(
time = []
lifespan = row[4]
if lifespan is not None:
time.append(lifespan._lower.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(lifespan._upper.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(lifespan._lower.strftime("%Y-%m-%dT%H:%M:%SZ"))
time.append(lifespan._upper.strftime("%Y-%m-%dT%H:%M:%SZ"))
else:
if extend_stbox is not None:
if extend_stbox.tmin is not None:
time.append(extend_stbox.tmin.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(extend_stbox.tmax.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(extend_stbox.tmin.strftime("%Y-%m-%dT%H:%M:%SZ"))
time.append(extend_stbox.tmax.strftime("%Y-%m-%dT%H:%M:%SZ"))
mfeature['time'] = time

if 'crs' not in mfeature:
Expand Down Expand Up @@ -1524,13 +1524,13 @@ def get_collection_item(self, request: Union[APIRequest, Any],
time = []
lifespan = row[4]
if lifespan is not None:
time.append(lifespan._lower.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(lifespan._upper.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(lifespan._lower.strftime("%Y-%m-%dT%H:%M:%SZ"))
time.append(lifespan._upper.strftime("%Y-%m-%dT%H:%M:%SZ"))
else:
if extend_stbox is not None:
if extend_stbox.tmin is not None:
time.append(extend_stbox.tmin.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(extend_stbox.tmax.strftime("%Y/%m/%dT%H:%M:%SZ"))
time.append(extend_stbox.tmin.strftime("%Y-%m-%dT%H:%M:%SZ"))
time.append(extend_stbox.tmax.strftime("%Y-%m-%dT%H:%M:%SZ"))
mfeature['time'] = time

if 'crs' not in mfeature:
Expand Down
19 changes: 7 additions & 12 deletions pygeoapi/flask_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,8 @@ def collections(collection_id=None):
api_.get_collection(request, collection_id))


@BLUEPRINT.route('/collections/<path:collection_id>/items',
methods=['GET', 'POST'])
@BLUEPRINT.route('/collections/<path:collection_id>/items/<item_id>',
methods=['GET', 'DELETE'])
@BLUEPRINT.route('/collections/<path:collection_id>/items', methods=['GET', 'POST'])
@BLUEPRINT.route('/collections/<path:collection_id>/items/<item_id>', methods=['GET', 'DELETE'])
def collection_items(collection_id, item_id=None):
"""
OGC API collections items endpoint
Expand All @@ -216,13 +214,11 @@ def collection_items(collection_id, item_id=None):
return get_response(
api_.get_collection_items(request, collection_id))
elif request.method == 'POST': # filter or manage items
return get_response(api_.manage_collection_item(request, 'create',
collection_id))
return get_response(api_.manage_collection_item(request, 'create', collection_id))

elif request.method == 'DELETE':
return get_response(
api_.manage_collection_item(request, 'delete',
collection_id, item_id))
api_.manage_collection_item(request, 'delete', collection_id, item_id))
else:
return get_response(
api_.get_collection_item(request, collection_id, item_id))
Expand All @@ -247,13 +243,12 @@ def collection_items_tgeometries(collection_id, item_id, tGeometry_id=None):
return get_response(
api_.get_collection_items_tGeometry(request, collection_id, item_id))
elif request.method == 'POST': # filter or manage items
return get_response(api_.manage_collection_item_tGeometry(request, 'create',
collection_id, item_id))
return get_response(
api_.manage_collection_item_tGeometry(request, 'create',collection_id, item_id))

elif request.method == 'DELETE':
return get_response(
api_.manage_collection_item_tGeometry(request, 'delete',
collection_id, item_id, tGeometry_id))
api_.manage_collection_item_tGeometry(request, 'delete', collection_id, item_id, tGeometry_id))


@BLUEPRINT.route('/collections/<path:collection_id>/items/<item_id>/tgsequence/<tGeometry_id>/velocity',
Expand Down
Loading

1 comment on commit 111942e

@TaehoonK
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#10 Fix some minor bugs (typo of interpolation type, date-time format, name of the queryable resources)

Please sign in to comment.