Or maybe better solution to save locations:
- create locations vector array and create last_location vector. Every few seconds check distance from the last location and current animal location. If distance > 1000 (or less/more) units add current location to array and set last_location as current location. This will add a location to the array when the animal travels a certain distance. Always keep a limited number of locations in array per animal.