1. A method of generating geofences, comprising: a) storing a plurality of stored locations; b) obtaining a first current location of a mobile device; c) identifying a plurality of nearest locations to the first current location out of the plurality of stored locations; d) identifying an outermost location of the plurality of nearest locations and determining an outer bound location based on the outermost location, the outer bound location being located farther from the first current location than any of the plurality of nearest locations other than the outermost location; e) generating, for each nearest location in the plurality of nearest locations except the outermost location, a local geofence around the nearest location; f) generating a triggering geofence around the first current location, the triggering geofence perimeter including at least the plurality of nearest locations other than the outermost location but not including the outer bound location; g) upon detecting that the mobile device has exited the triggering geofence iterating steps b) to f) for a new current location of the mobile device.