Skip to content

Instantly share code, notes, and snippets.

@bhuiyanmobasshir94
Forked from jsundram/cull.py
Created December 13, 2018 19:00
Show Gist options
  • Save bhuiyanmobasshir94/027ef2ac9a3ff1e79cad93c226571729 to your computer and use it in GitHub Desktop.
Save bhuiyanmobasshir94/027ef2ac9a3ff1e79cad93c226571729 to your computer and use it in GitHub Desktop.
Check if lat long is inside the bounds of the continental US (box model, not shape)
# http://en.wikipedia.org/wiki/Extreme_points_of_the_United_States#Westernmost
top = 49.3457868 # north lat
left = -124.7844079 # west long
right = -66.9513812 # east long
bottom = 24.7433195 # south lat
def cull(l):
c = []
for (lat, lng) in l:
if bottom <= lat <= top and left <= lng <= right:
c.append((lat, lng))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment