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].
Asked
Active
Viewed 149 times
1 Answers
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
-
Is it possible to do this without looping through each location point? – so_many_questions May 06 '20 at 23:46