Skip to content

Commit

Permalink
disable spatial coverage query
Browse files Browse the repository at this point in the history
  • Loading branch information
devincowan committed Oct 12, 2023
1 parent fd11a10 commit cb70a7d
Showing 1 changed file with 13 additions and 9 deletions.
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

0 comments on commit cb70a7d

Please sign in to comment.