Patent ID: 8626187

Claim:
A method performed by a mobile device, comprising: determining that the mobile device is inside of a first geofence defined by a plurality of first wireless access points and a second geofence defined by a plurality of second wireless access points, including determining that the mobile device has detected a signal from at least one of the first wireless access points and at least one of the second wireless access points; creating a temporary geofence, including designating a current location of the mobile device as a fence location of the temporary geofence, the temporary geofence intersecting both the first geofence and the second geofence; identifying one or more common gateways for monitoring the temporary geofence, the common gateways including one or more wireless access points observable by the mobile device when the mobile device is located in both of the first geofence and the second geofence; designating at least one of the identified common gateways as an exit gateway for monitoring an exit from the temporary geofence; detecting an exit of the mobile device from the temporary geofence, including determining that, for at least a threshold number of scans, the exit gateway is unobservable by the mobile device; and upon detecting the exit from the temporary geofence, determining that the mobile device exited the first geofence or the second geofence.