Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Add clearer documentation on the format of boxes #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# attached will be checked to see which area it is in. If there's a match, it will be annotated with the area
# name. If no match, the neighborhood field, which is a string, will be checked to see if it matches
# anything in NEIGHBORHOODS.
# Format for theses boxes is: ["your box name": [<bottom right lat>, <bottom right long>], [<top left lat>, <top left long>]]
BOXES = {
"adams_point": [
[37.80789, -122.25000],
Expand Down Expand Up @@ -124,4 +125,4 @@
try:
from config.private import *
except Exception:
pass
pass
2 changes: 1 addition & 1 deletion util.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def in_box(coords, box):
"""
Find if a coordinate tuple is inside a bounding box.
:param coords: Tuple containing latitude and longitude.
:param box: Two tuples, where first is the bottom left, and the second is the top right of the box.
:param box: Two tuples, where first is the bottom right, and the second is the top left of the box.
:return: Boolean indicating if the coordinates are in the box.
"""
if box[0][0] < coords[0] < box[1][0] and box[1][1] < coords[1] < box[0][1]:
Expand Down