Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable spatial coverage query #59

Merged
merged 1 commit into from
Oct 16, 2023
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
22 changes: 13 additions & 9 deletions hsclient/hydroshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -1446,15 +1446,19 @@ def search(
if to_date:
params["to_date"] = to_date.strftime('%Y-%m-%d')
if spatial_coverage:
params["coverage_type"] = spatial_coverage.type
if spatial_coverage.type == "point":
params["north"] = spatial_coverage.north
params["east"] = spatial_coverage.east
else:
params["north"] = spatial_coverage.northlimit
params["east"] = spatial_coverage.eastlimit
params["south"] = spatial_coverage.southlimit
params["west"] = spatial_coverage.westlimit
yield Exception(
"Bad Request, status_code 400, spatial_coverage queries are disabled."
)
# TODO: re-enable after resolution of https://github.com/hydroshare/hydroshare/issues/5240
# params["coverage_type"] = spatial_coverage.type
# if spatial_coverage.type == "point":
# params["north"] = spatial_coverage.north
# params["east"] = spatial_coverage.east
# else:
# params["north"] = spatial_coverage.northlimit
# params["east"] = spatial_coverage.eastlimit
# params["south"] = spatial_coverage.southlimit
# params["west"] = spatial_coverage.westlimit
response = self._hs_session.get("/hsapi/resource/", 200, params=params)

res = response.json()
Expand Down
Loading