Skip to content

Commit

Permalink
Merge pull request #59 from hydroshare/disable-spatial-query
Browse files Browse the repository at this point in the history
disable spatial coverage query
  • Loading branch information
devincowan authored Oct 16, 2023
2 parents fd11a10 + cb70a7d commit 6e3ad7b
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 6e3ad7b

Please sign in to comment.