Skip to content

Commit

Permalink
Merge pull request #151 from stac-utils/patch/rename-point-endpoint
Browse files Browse the repository at this point in the history
rename point endpoint to with `/point` prefix
  • Loading branch information
vincentsarago authored Jan 10, 2024
2 parents be9cf40 + 68e14ec commit d1493c4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions tests/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def test_bbox_collection(rio, app):
def test_query_point_collections(app):
"""Get values for a Point."""
response = app.get(
f"/collections/{collection_id}/-85.5,36.1624/values", params={"assets": "cog"}
f"/collections/{collection_id}/point/-85.5,36.1624", params={"assets": "cog"}
)

assert response.status_code == 200
Expand All @@ -486,7 +486,7 @@ def test_query_point_collections(app):

# with coord-crs
response = app.get(
f"/collections/{collection_id}/-9517816.46282489,4322990.432036275/values",
f"/collections/{collection_id}/point/-9517816.46282489,4322990.432036275",
params={"assets": "cog", "coord_crs": "epsg:3857"},
)
assert response.status_code == 200
Expand All @@ -495,7 +495,7 @@ def test_query_point_collections(app):

# CollectionId not found
response = app.get(
"/collections/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/-85.5,36.1624/values",
"/collections/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/point/-85.5,36.1624",
params={"assets": "cog"},
)
assert response.status_code == 404
Expand All @@ -504,7 +504,7 @@ def test_query_point_collections(app):

# at a point with no assets
response = app.get(
f"/collections/{collection_id}/-86.0,-35.0/values", params={"assets": "cog"}
f"/collections/{collection_id}/point/-86.0,-35.0", params={"assets": "cog"}
)

assert response.status_code == 204 # (no content)
8 changes: 4 additions & 4 deletions tests/test_searches.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ def test_bbox(rio, app, search_no_bbox):
def test_query_point_searches(app, search_no_bbox, search_bbox):
"""Test getting values for a Point."""
response = app.get(
f"/searches/{search_no_bbox}/-85.5,36.1624/values", params={"assets": "cog"}
f"/searches/{search_no_bbox}/point/-85.5,36.1624", params={"assets": "cog"}
)

assert response.status_code == 200
Expand All @@ -987,7 +987,7 @@ def test_query_point_searches(app, search_no_bbox, search_bbox):

# with coord-crs
response = app.get(
f"/searches/{search_no_bbox}/-9517816.46282489,4322990.432036275/values",
f"/searches/{search_no_bbox}/point/-9517816.46282489,4322990.432036275",
params={"assets": "cog", "coord_crs": "epsg:3857"},
)
assert response.status_code == 200
Expand All @@ -996,7 +996,7 @@ def test_query_point_searches(app, search_no_bbox, search_bbox):

# SearchId not found
response = app.get(
"/searches/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/-85.5,36.1624/values",
"/searches/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/point/-85.5,36.1624",
params={"assets": "cog"},
)
assert response.status_code == 404
Expand All @@ -1005,7 +1005,7 @@ def test_query_point_searches(app, search_no_bbox, search_bbox):

# outside of searchid bbox
response = app.get(
f"/searches/{search_bbox}/-86.0,35.0/values", params={"assets": "cog"}
f"/searches/{search_bbox}/point/-86.0,35.0", params={"assets": "cog"}
)

assert response.status_code == 204 # (no content)
2 changes: 1 addition & 1 deletion titiler/pgstac/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ def _point_routes(self):
"""Register point values endpoint."""

@self.router.get(
"/{lon},{lat}/values",
"/point/{lon},{lat}",
response_model=Point,
response_class=JSONResponse,
responses={200: {"description": "Return a value for a point"}},
Expand Down

0 comments on commit d1493c4

Please sign in to comment.