0

I am writing code in Pythonista for iOS. I am trying to create a program that can "sense" the proximity of my phone to a location and then trigger actions once near that location. I am using the location module in Pythonista and I have only been able to "get" my phone's current location below. Can anyone help introduce me to the code that I need?

location.start_updates()
time.sleep(5)
loc = location.get_location()
addr = location.reverse_geocode(loc)
location.stop_updates()
oezeadi
  • 77
  • 1
  • 7
  • 1
    It sounds like you got the phone's location, what else do you need after that? It also sounds like you have a particular anchor location in mind. Are you wondering how to determine if the location you received from the phone is within some distance of that anchor location? – Phillip Martin Nov 22 '17 at 22:30
  • Yes, I'd like to get my relative location to the anchor location in hopes to set a program that can send a text message to a recipient (my wife) when I'm "near" her job – oezeadi Nov 22 '17 at 23:45
  • So maybe some kind of if statement that says "If near location x then perform action" – oezeadi Nov 22 '17 at 23:47
  • 1
    check out the haversine formula - https://stackoverflow.com/questions/4913349/haversine-formula-in-python-bearing-and-distance-between-two-gps-points – Phillip Martin Nov 23 '17 at 15:21

0 Answers0