Skip to content

Commit

Permalink
Merge pull request #109 from observerly/feature/crud/body
Browse files Browse the repository at this point in the history
feat: Added { latitude } filtering to CRUDBody for self.model.dec.
  • Loading branch information
michealroberts committed May 24, 2023
2 parents 9f8b6ea + b66cfa9 commit ee2b5b6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/crud/crud_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ def perform_horizontal_altitude_search_filter(
# Latitude & Longitude (in degrees):
latitude = getattr(query_params, "latitude", None)

if latitude and latitude > 0:
query = query.filter(
self.model.dec > latitude - 90,
)

if latitude and latitude < 0:
query = query.filter(
self.model.dec > latitude - 90,
)

longitude = getattr(query_params, "longitude", None)

# Performs a search for the give body above a local altitude of 15 degrees
Expand Down

0 comments on commit ee2b5b6

Please sign in to comment.