-1

Currently working in python. I have a time series data with lat/lon as coordinates. Whats the most efficient way to determine if you are in an area you have visited before? Ex. In the image below, I would want to flag the 11th and 12th location because they are near location 2. However, I would not want to flag any locations that are nearby if they are consecutive. I'd want to output something like [0, 0, 0... 1, 1, 0].

https://i.stack.imgur.com/ttLWb.png

1 Answers1

0

You could store each visited coordinate inside a dict or a set, and then simply do if coordinate in <dict or set>, being the variable you assigned the dict or set to. coordinate in <dict or set> will return True if you've already visited it, and False otherwise.

puppydog
  • 385
  • 3
  • 14